Article View: gnu.gcc.bug
Article #2812gcc warning: empty body in else-statement
From: Jan Edler
Date: Mon, 08 Jan 1990 22:42
Date: Mon, 08 Jan 1990 22:42
26 lines
1100 bytes
1100 bytes
(I'm using the NYU internal version of gcc for the ibm rt pc, if it matters).
If I compile with -Wall, I get warnings about else statements with
empty bodies, e.g.
if (expr)
f();
else ;
In my case the empty body is generated by a macro.
1) These warnings don't seem very useful to me; am I missing something?
Is there a common error that will be caught by the warning?
2) Is there a way to turn them off, and still keep -Wall?
3) I can suppress them by using a null inline function, like
static inline void null() { }
and change my macro to evaluate to null(); is there a better way?
Jan Edler
NYU Ultracomputer Research Laboratory
edler@nyu.edu
Technical Details
Message-ID:
<9001082242.AA00768@jan.ultra.nyu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!JAN.ULTRA.NYU.EDU!edlerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!JAN.ULTRA.NYU.EDU!edler From: edler@JAN.ULTRA.NYU.EDU (Jan Edler) Newsgroups: gnu.gcc.bug Subject: gcc warning: empty body in else-statement Message-ID: <9001082242.AA00768@jan.ultra.nyu.edu> Date: 8 Jan 90 22:42:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 26