This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/65452] strcmp (foo, foo) could give a warning
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Oct 2016 15:40:39 +0000
- Subject: [Bug c/65452] strcmp (foo, foo) could give a warning
- Auto-submitted: auto-generated
- References: <bug-65452-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65452
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Created attachment 39880
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39880&action=edit
Wsame-arguments
I'm attaching a patch to implement a warning for this, named -Wsame-arguments.
The problem is that the C++ FE doesn't have good location information for
arguments of functions, so the warning's not really useful for C++. And
another problem is that constants/decls don't have location information, so
there might be false positives.