Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!orion.oac.uci.edu!uci-ics!rfg From: rfg@ics.uci.edu (Ron Guilmette) Newsgroups: gnu.gcc.bug Subject: Re: suggested improvement to assert.h Message-ID: <25B8B716.7104@paris.ics.uci.edu> Date: 20 Jan 90 19:08:05 GMT References: <9001200425.AA02377@spot.twinsun.com> Reply-To: rfg@ics.uci.edu (Ron Guilmette) Distribution: gnu Organization: UC Irvine Department of ICS Lines: 22 In article <9001200425.AA02377@spot.twinsun.com> coleman@twinsun.com (Mike Coleman) writes: >calls to the GNU assert macro cause the error message > >file.c:2059: warning: ANSI C forbids conditional expr with only one void side > >when compiled with -ansi -pedantic. This can be prevented by changing > >#define assert(expression) \ > ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)) > >to > >#define assert(expression) \ > ((expression) ? (void) 0 : __assert (#expression, __FILE__, __LINE__)) > >in assert.h. The only penalty I can see is the miniscule cost of compiling >the extra cast. As long as we're at it, could we perhaps also have an extern declaration for __assert() so that we can avoid warnings when using -Wimplicit? // rfg