[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150507090034.GV16501@mwanda>
Date: Thu, 7 May 2015 12:00:34 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Chris Metcalf <cmetcalf@...hip.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Fabian Frederick <fabf@...net.be>,
Randy Dunlap <rdunlap@...radead.org>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
Greg KH <gregkh@...uxfoundation.org>,
Peter Zijlstra <peterz@...radead.org>,
"David S. Miller" <davem@...emloft.net>,
Frederic Weisbecker <fweisbec@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Sam Ravnborg <sam@...nborg.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
"Theodore Ts'o" <tytso@....edu>,
Grant Likely <grant.likely@...aro.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 2/3] string: provide strscpy() and strscpy_truncate()
On Wed, May 06, 2015 at 06:45:56PM +0200, Geert Uytterhoeven wrote:
> On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> > We actually do have a __must_check tag so it's easy enough to force
> > people to check. A different option is we could make it trigger a
>
> People tend to ignore compiler warnings...
We're doing a lot better these days with zero day build testing. There
is not even one ignored __must_check return in my allmodconfig.
>
> > WARN_ONCE().
> >
> > #define strXcpy(dest, src, len) (({ \
> > ssize_t __ret = strscpy_truncate(dest, src, len); \
> > WARN_ONCE(__ret < 0, "strXcpy trancates\n"); \
> > __ret; }))
>
> Which will probably trigger only in extreme cases in the wild, not during
> development.
It's less subtle than just putting an empty string there so we're more
likely to get bug reports than with the original code.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists