Messages in this thread | | | Date | Wed, 23 Jun 1999 16:34:29 +0200 (CEST) | From | (Arjan van de Ven) | Subject | Re: [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/
| |