[gtk-list] g_assert() is #*!(
- From: Tim Janik <Tim Janik Hamburg Netsurf DE>
- To: |gtk mailing list <gtk-list redhat com>
- Subject: [gtk-list] g_assert() is #*!(
- Date: Sun, 11 May 1997 07:48:35 +0200 (CEST)
humpf, i just trapped a code sequence like this
{
gpointer a;
a=NULL;
if (!a)
g_assert(!a);
else
g_assert(a);
}
on the first look this should work but:
#define g_assert(expr) \
if (!(expr)) \
g_error ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr)
because of the "if () g_error()"; definition both lines,
the
g_assert(!a);
and
g_assert(a);
get executed.
what about:
#define g_assert(expr) { \
if (!(expr)) \
g_error ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr) }
comments, suggestions, flames, comfort?
---
ciaoTJ
Tim.Janik@Hamburg.Netsurf.DE [signature: <CENS||ED>]
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]