Re: [AD] Proposed ASSERT protection |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, Sep 12, 2002 at 06:33:23PM +0200, Grzegorz Adam Hankiewicz wrote:
> I did, and now I will concentrate on other things. Note that there are
> many more assertions which could be made, but it's a little bit tricky
> what to restrict: there are things which for example are matematically
> allowable (ie: using negative parameters which don't hurt because they
> are used in a loop with a lesser-than comparison which exits immediately)
> but which from my point of view show either the programmer is now knowing
> what (s)he's doing or something has gone terribly wrong in the caller.
I use very strickt assertions in my own code, and it really helped me to
find bugs on more than once (that, and Peter's article on using gdb).
So, yes, IMO, pedantic ASSERTions are a good thing.
See my remark below, though.
> Translation: don't want to hear cries from people who's programs stopped
> working due to extremely pedantic assertions. I'll revert any assertion
> happily if it shows to break code, though I ran most of allegro's binaries
> and none aborted.
Well, their programs will work without incident when linking with the optimized
library, or so it might.
Perhaps there could be a `weakend' version of ASSERT than only prints a message
to the console warning of a possible bug in the caller (Windows users are out
of luck here)?
Or perhaps the could be an option to the debug build of the library, something
like PEDANTIC_ASSERTIONS=1?
--
Evert Glebbeek, Physics student
Faculty of Science, University of Amsterdam
Institute for Theoretical Physics, room W3.132
e-mail: eglebbk@xxxxxxxxxx tel. 7314
www: http://www.science.uva.nl/~eglebbk/