lkml.org 
[lkml]   [2012]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] utilize _Static_assert() for BUILD_BUG_ON() when the compiler supports it
On Fri, 02 Nov 2012 14:47:40 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:

> This makes the resulting diagnostics quite a bit more useful.

So asserts Jan, but to confirm it I would need to download, configure,
build and install a different gcc version, which sounds rather a hassle.

So, please show us an exmple of these diagnostics in the changelog.

> --- 3.7-rc3/include/linux/bug.h
> +++ 3.7-rc3-static-assert/include/linux/bug.h
> @@ -27,8 +27,15 @@ struct pt_regs;
> result (of value 0 and type size_t), so the expression can be used
> e.g. in a structure initializer (or where-ever else comma expressions
> aren't permitted). */
> +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)

This sort of logic is normally performed via the
include/linux/compiler*.h system. And

grep __GNUC include/linux/*.h

indicates that we've been pretty successful. Can we do that here too?

(eg: suppose the Intel compiler supports _Static_assert?)



\
 
 \ /
  Last update: 2012-11-06 00:02    [W:0.888 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site