[Bug c/65253] Wmemsize-comparison
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 24 01:52:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65253
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |brobecker at gnat dot com,
| |howarth.at.gcc at gmail dot com
--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #1)
> (In reply to Manuel López-Ibáñez from comment #0)
> > Clang does:
> >
> > remote.c:5519:47: warning: size argument in 'strncmp' call is a
> > comparison [-Wmemsize-comparison]
> > && strncmp (p, "core", strlen ("core") != 0))
> > ~~~~~~~~~~~~~~~~^~~~
> > remote.c:5519:11: note: did you mean to compare the result of 'strncmp'
> > instead?
> > && strncmp (p, "core", strlen ("core") != 0))
> > ^ ~
> > )
> > remote.c:5519:31: note: explicitly cast the argument to size_t to
> > silence this warning
> > && strncmp (p, "core", strlen ("core") != 0))
> > ^
> > (size_t)( )
> >
> > and it founds bugs in gdb:
> > https://sourceware.org/ml/gdb/2015-02/msg00088.html
>
> I'll take the gdb discussion as confirmation
cc-ing people from it
More information about the Gcc-bugs
mailing list