🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #896

suggested improvement to assert.h

#896
From: Mike Coleman
Date: Sat, 20 Jan 1990 04:25
19 lines
950 bytes
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.

Mike Coleman
coleman@twinsun.com
Technical Details
Message-ID: <9001200425.AA02377@spot.twinsun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!twinsun.com!coleman

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!twinsun.com!coleman
From: coleman@twinsun.com (Mike Coleman)
Newsgroups: gnu.gcc.bug
Subject: suggested improvement to assert.h
Message-ID: <9001200425.AA02377@spot.twinsun.com>
Date: 20 Jan 90 04:25:50 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 19