Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-11-03 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: >> Realistically, a single macro could be defined in compiler*.h that >> encapsulates the entirety of this mechanism and only exposes a "black >> box" macro, that will simply expand to something that breaks the build >> in the most appropriate fashion

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-11-03 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: Realistically, a single macro could be defined in compiler*.h that encapsulates the entirety of this mechanism and only exposes a black box macro, that will simply expand to something that breaks the build in the most appropriate fashion based

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-31 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: > On Wed, Oct 31, 2012 at 12:34:45AM -0500, Daniel Santos wrote: >> Yes, the __build_bug_on_failed message is much more informative. This >> will only increase with these patches. For example, the line >> >> BUILD_BUG_ON(sizeof(*c) != 4); >> >>

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-31 Thread Borislav Petkov
On Wed, Oct 31, 2012 at 12:34:45AM -0500, Daniel Santos wrote: > Yes, the __build_bug_on_failed message is much more informative. This > will only increase with these patches. For example, the line > > BUILD_BUG_ON(sizeof(*c) != 4); > > emits this error: > > arch/x86/kernel/cpu/amd.c: In

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-31 Thread Borislav Petkov
On Wed, Oct 31, 2012 at 12:34:45AM -0500, Daniel Santos wrote: Yes, the __build_bug_on_failed message is much more informative. This will only increase with these patches. For example, the line BUILD_BUG_ON(sizeof(*c) != 4); emits this error: arch/x86/kernel/cpu/amd.c: In function

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-31 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: On Wed, Oct 31, 2012 at 12:34:45AM -0500, Daniel Santos wrote: Yes, the __build_bug_on_failed message is much more informative. This will only increase with these patches. For example, the line BUILD_BUG_ON(sizeof(*c) != 4); emits this error:

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-30 Thread Daniel Santos
On 10/30/2012 11:19 AM, Borislav Petkov wrote: > On Sun, Oct 28, 2012 at 03:57:12PM -0500, danielfsan...@att.net wrote: >> Prior to the introduction of __attribute__((error("msg"))) in gcc 4.3, >> creating compile-time errors required a little trickery. >> BUILD_BUG{,_ON} uses this attribute when

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-30 Thread Borislav Petkov
On Sun, Oct 28, 2012 at 03:57:12PM -0500, danielfsan...@att.net wrote: > Prior to the introduction of __attribute__((error("msg"))) in gcc 4.3, > creating compile-time errors required a little trickery. > BUILD_BUG{,_ON} uses this attribute when available to generate > compile-time errors, but

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-30 Thread Borislav Petkov
On Sun, Oct 28, 2012 at 03:57:12PM -0500, danielfsan...@att.net wrote: Prior to the introduction of __attribute__((error(msg))) in gcc 4.3, creating compile-time errors required a little trickery. BUILD_BUG{,_ON} uses this attribute when available to generate compile-time errors, but also uses

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-30 Thread Daniel Santos
On 10/30/2012 11:19 AM, Borislav Petkov wrote: On Sun, Oct 28, 2012 at 03:57:12PM -0500, danielfsan...@att.net wrote: Prior to the introduction of __attribute__((error(msg))) in gcc 4.3, creating compile-time errors required a little trickery. BUILD_BUG{,_ON} uses this attribute when available

[PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-28 Thread danielfsantos
Prior to the introduction of __attribute__((error("msg"))) in gcc 4.3, creating compile-time errors required a little trickery. BUILD_BUG{,_ON} uses this attribute when available to generate compile-time errors, but also uses the negative-sized array trick for older compilers, resulting in two

[PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-28 Thread danielfsantos
Prior to the introduction of __attribute__((error(msg))) in gcc 4.3, creating compile-time errors required a little trickery. BUILD_BUG{,_ON} uses this attribute when available to generate compile-time errors, but also uses the negative-sized array trick for older compilers, resulting in two error