This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/65452] strcmp (foo, foo) could give a warning


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]