[PATCH] GDB friendly assert
Thu Mar 1 09:06:00 GMT 2001
Andrew Cagney wrote:
> Mark Kettenis wrote:
> > Date: Tue, 24 Oct 2000 23:46:47 +1100
> > From: Andrew Cagney <firstname.lastname@example.org>
> > Thanks! Good move.
> > My only (A.R.) thought is to make the macro upper case so it is very
> > clear to developers that they are using a MACRO and not a function.
> > Hmm, my idea was that it simply is the standard assert() (which
> > typically is a macro) with gdb_ prepended.
> Yes, I know. I'm trying to trade off ``MACRO's are upper case'' against
> ``assert()'' in lower-case is more consistent with STDC even if it was a
> bad idea.
> > But if you feel it should
> > be changed into GDB_ASSERT, I'll be happy to change it.
> I don't know :-)
To close this, I'm going to add a comment to "gdb_assert.h" noting that
there is a tradeoff between these two. lcase was chosen as it is closer
to the existing UNIX convention.
As a btw, people adding new code may want to use gdb_assert() in
preference to internal error. It is shorter and more convenient.
More information about the Gdb-patches