This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23193] New: useless comparison warning
- From: "phython at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Aug 2005 06:12:00 -0000
- Subject: [Bug c/23193] New: useless comparison warning
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC should probably warn about useless comparison.
e.g.
#include <stdlib.h>
extern int *bar (int *);
int * foo (int a, int *c, int *b) {
int *ret = NULL;
if (a)
ret = c;
else
ret == bar (b);
return ret;
}
--
Summary: useless comparison warning
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: phython at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23193