[PATCH] include: add BUG_WARN macro for internal bug cases.

Chase Douglas chase.douglas at canonical.com
Wed Nov 9 08:24:57 PST 2011


On 11/08/2011 09:14 PM, Peter Hutterer wrote:
> There are plenty of cases that can only be triggered by a real bug in the
> server and doing the ErrorF dance manually everywhere is a tad painful and
> the error message is usually used only to find the spot in the file anyway.
> 
> Plus, reading BUG_WARN somewhere is a good indicator to the casual reader
> that this isn't intended behaviour.
> 
> Note that this is intentionally different to the BUG_ON behaviour on the
> kernel, we do not FatalError the server. It's just a warning + stacktrace.
> If the bug is really fatal, call FatalError.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

It's about time we had something like this :). The only question I have
is whether the server is assumed to be compiled under C99 semantics. If
not, __func__ may not be defined by the compiler. I'm going to assume
the answer is yes:

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>


More information about the xorg-devel mailing list