lkml.org 
[lkml]   [1999]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] *(int*)0 = 0 & variations
Riley Williams had the wisdom to write:
RW> Hi there.

>>> * assert()

RW> +#ifdef DEBUG
RW> +#define kassert(cond) if (!(cond)) \
RW> + printk(KERN_DEBUG "ASSERTION FAILURE: %s line %u: %s\n", \
RW> + __FILE__, __LINE__, "cond")
RW> +#else
RW> +#define kassert(cond)
RW> +#endif


Please modify the second kassert to


#define kassert(cond) if (cond) ;

That way,

kassert(var++)

works the same with and without DEBUG.

(I know, one shouldn't change a variable in an assert, but there is NO
decent way to find such bugs)

Greetings,
Arjan van de Ven


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.098 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site