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 wrote:
> There is also the fact that by its nature, assertion checking makes
> most of the standard oops report redundant as, if kassertoops was to
> be used, the exact circumstances would be known in advance. It would
> therefore make more sense to have two separate oops functions, one to
> deal with the current oops events, and a second to deal with an oops
> caused by a kassertoops() call.

Maybe call panic() or similar, instead of oops-ing?


> Here's the corrected version:
[...]
> +#ifdef DEBUG

'DEBUG' is far too general. __USING_KASSERT?


> +#else
> +#define kassert(cond) (void) abs(cond)
> +#define kassertoops(cond) (void) abs(cond)
> +#endif

Any code depending on assert evaluating the condition is broken IMHO.
Doing so breaks an important feature of assert: it evaluates to nothing
when disabled. Your above example violates the principle of least
surprise; instead, it should be ((void)0)

Once it does that, please do submit it to the Upper Penguins. ;-)

Jeff

-
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.063 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site