Article View: gnu.gcc.bug
Article #6389strange warning in 2.7.1 (and older ones)
From: Ulrich Windl
Date: Wed, 22 Nov 1995 00:00
Date: Wed, 22 Nov 1995 00:00
25 lines
1449 bytes
1449 bytes
I don't quite understand why the compiler complains about one line of C:
(My CFLAGS):
CFLAGS=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
-Wwrite-strings -Wtraditional -Wstrict-prototypes \
-Wnested-externs -O3 -ggdb3 -DPATH_MAX=255 -pipe
(gc-2.7.1):
genstamm.c: In function `exported_filename':
genstamm.c:99: warning: suggest parentheses around && within ||
(genstamm.c#99):
if ( PATIENTNO[0] != ' ' && PATIENTNO[0] != '0' ||
PATIENTNO[1] != ' ' && PATIENTNO[1] != '0' )
return(-1);
I think here the situation is rather clear ("&&" is stronger than "||").
On the other hand the compiler does not warn about "v & 3 == 1".
Something like "expression is const" or "code has no effect" would not
bee too bad. I've found the example above in the Linux-1.2.13 pci.c file
(not literally). Obviously that kind of error is still made.
Anything to be done?
Ulrich
Technical Details
Message-ID:
<Pine.HPP.3.91.951122125701.21465A-100000@rkdvmhp1.dvm.klinik.uni-regensburg.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,583e4cae6f7f77e2,start X-Google-Attributes: gid113d02,public From: windl@rkdvmhp1.dvm.klinik.uni-regensburg.DE (Ulrich Windl) Subject: strange warning in 2.7.1 (and older ones) Date: 1995/11/22 Message-ID: <Pine.HPP.3.91.951122125701.21465A-100000@rkdvmhp1.dvm.klinik.uni-regensburg.de> X-Deja-AN: 119950303 distribution: gnu sender: daemon@cis.ohio-state.edu organization: GNUs Not Usenet reply-to: Ulrich.Windl@rz.uni-regensburg.de newsgroups: gnu.gcc.bug