Article View: gnu.gcc.bug
Article #573Erroneous warning message in 1.35
From: Paul Hilfinger
Date: Wed, 06 Sep 1989 20:37
Date: Wed, 06 Sep 1989 20:37
41 lines
1238 bytes
1238 bytes
I get the incorrect warning message
bad-msg1.c:17: warning: control reaches end of non-void function
when compiling the appended file with command line
gcc -g -Wall -c bad-msg1.c
or the (also incorrect) warning message
bad-msg1.c:17: warning: this function may return with or without a value
when compiling with
gcc -g -W -c bad-msg1.c
The messages go away with the -O switch.
Gcc version 1.35 on a Sun-3 (md == m68k.md, tm.h == tm-sun3-nfp.h).
-- P. N. Hilfinger
---------------------------------------- cut here --------------------
static int getToken()
{
int xxx;
if (xxx) {
if (xxx)
return xxx;
else
return xxx;
}
else if (xxx) {
return xxx;
}
else {
return xxx;
}
}
Technical Details
Message-ID:
<8909062037.AA03466@tully.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!GINGER.BERKELEY.EDU!hilfingr%tully.Berkeley.EDUShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!GINGER.BERKELEY.EDU!hilfingr%tully.Berkeley.EDU From: hilfingr%tully.Berkeley.EDU@GINGER.BERKELEY.EDU (Paul Hilfinger) Newsgroups: gnu.gcc.bug Subject: Erroneous warning message in 1.35 Message-ID: <8909062037.AA03466@tully.Berkeley.EDU> Date: 6 Sep 89 20:37:39 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41