[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FCC9D7F.7070404@att.net>
Date: Mon, 04 Jun 2012 06:35:27 -0500
From: Daniel Santos <danielfsantos@....net>
To: Paul Gortmaker <paul.gortmaker@...driver.com>,
Jason Wessel <jason.wessel@...driver.com>
CC: linux-kernel@...r.kernel.org
Subject: [PATCH] linux/bug.h: make BUILD_BUG_ON generate compile-time error
This is pretty straight-forward. __compiletime_error is defined in
compiler-gcc4.h with appropriate version checks, so shouldn't break on
older compilers. This makes the difference between getting an error at
link-time and getting one at compile time. Example:
/home/daniel/proj/kernel/grbtest/grbtest2.c:83:2: error: call to
‘__build_bug_on_failed’ declared with attribute error: BUILD_BUG_ON
failed: !__builtin_constant_p(count)
The above points me directly to where I called BUILD_BUG_ON. Note that
I'm moving __build_bug_on_failed out of the global scope, just so it can
be re-declared with different attributes each time.
Daniel
View attachment "0006-linux-bug.h-make-BUILD_BUG_ON-generate-compile-time-.patch" of type "text/x-patch" (1077 bytes)
Powered by blists - more mailing lists