🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3269

Problem with assert.h in Manx 5.0, and a fix

#3269
From: Karl Lehenbauer
Date: Thu, 12 Apr 1990 02:36
19 lines
1111 bytes
There is a problem with the assert macro in assert.h in Manx 5.0.  It cost
me a bit of time to find, damn it, and I thought I'd save anyone else the
hassle.  The problem occurs when there is a compound expression in an
assert, as in:

	assert(!Playing || (next_event_ticks != BIG_NUMBER));

Only the second half of the assert is actually checked.  In the file, the
macro is defined (I only show a bit of it here for to avoid possible copyright
problems)

#define assert(x) (x == 0) ? ...

It needs to be changed to:

#define assert(x) ((x) == 0) ? ...
-- 
-- uunet!sugar!karl   "I hate quotations.  Tell me what you know." -- Emerson
-- Usenet access: (713) 438-5018
Technical Details
Message-ID: <5563@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!sugar!karl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!sugar!karl
From: karl@sugar.hackercorp.com (Karl Lehenbauer)
Newsgroups: comp.sys.amiga.tech
Subject: Problem with assert.h in Manx 5.0, and a fix
Message-ID: <5563@sugar.hackercorp.com>
Date: 12 Apr 90 02:36:36 GMT
Reply-To: karl@sugar.hackercorp.com.hackercorp.com (Karl Lehenbauer)
Organization: Sugar Land Unix - Houston
Lines: 19