Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 6 May 2015 18:45:56 +0200 | Subject | Re: [PATCH 2/3] string: provide strscpy() and strscpy_truncate() | From | Geert Uytterhoeven <> |
| |
On Wed, May 6, 2015 at 5:59 PM, Dan Carpenter <dan.carpenter@oracle.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...
> 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.
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
| ![\](/images/icornerr.gif) |