Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-10-02 Thread Daniel Santos
On 10/01/2012 07:48 PM, Michel Lespinasse wrote: > On Fri, Sep 28, 2012 at 4:20 PM, Daniel Santos > wrote: >> Negative sized arrays wont create a compile-time error in some cases >> starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced >> the error function attribute that will.

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-10-02 Thread Daniel Santos
On 10/01/2012 07:48 PM, Michel Lespinasse wrote: On Fri, Sep 28, 2012 at 4:20 PM, Daniel Santos daniel.san...@pobox.com wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-10-01 Thread Michel Lespinasse
On Fri, Sep 28, 2012 at 4:20 PM, Daniel Santos wrote: > Negative sized arrays wont create a compile-time error in some cases > starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced > the error function attribute that will. This patch modifies > BUILD_BUG_ON to behave like

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-10-01 Thread Michel Lespinasse
On Fri, Sep 28, 2012 at 4:20 PM, Daniel Santos daniel.san...@pobox.com wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This patch modifies BUILD_BUG_ON

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-30 Thread Josh Triplett
On Sun, Sep 30, 2012 at 06:29:01PM -0500, Daniel Santos wrote: > On 09/28/2012 09:55 PM, Josh Triplett wrote: > > Assuming you don't call BUILD_BUG_ON_MSG more than once per line: > > > > /tmp$ cat test.c > > #define BUILD_BUG_ON_MSG_INTERNAL2(cond, msg, line) \ > > do { \ > > extern

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-30 Thread Daniel Santos
On 09/28/2012 09:55 PM, Josh Triplett wrote: > Assuming you don't call BUILD_BUG_ON_MSG more than once per line: > > /tmp$ cat test.c > #define BUILD_BUG_ON_MSG_INTERNAL2(cond, msg, line) \ > do { \ > extern void __build_bug_on_failed_ ## line (void) > __attribute__((error(msg))); \ >

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-30 Thread Daniel Santos
On 09/28/2012 09:55 PM, Josh Triplett wrote: Assuming you don't call BUILD_BUG_ON_MSG more than once per line: /tmp$ cat test.c #define BUILD_BUG_ON_MSG_INTERNAL2(cond, msg, line) \ do { \ extern void __build_bug_on_failed_ ## line (void) __attribute__((error(msg))); \

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-30 Thread Josh Triplett
On Sun, Sep 30, 2012 at 06:29:01PM -0500, Daniel Santos wrote: On 09/28/2012 09:55 PM, Josh Triplett wrote: Assuming you don't call BUILD_BUG_ON_MSG more than once per line: /tmp$ cat test.c #define BUILD_BUG_ON_MSG_INTERNAL2(cond, msg, line) \ do { \ extern void

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Josh Triplett
On Fri, Sep 28, 2012 at 08:26:08PM -0500, Daniel Santos wrote: > On 09/28/2012 07:32 PM, Josh Triplett wrote: > > On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: > >> Negative sized arrays wont create a compile-time error in some cases > >> starting with gcc 4.4 (e.g., inlined

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: > On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: >> Negative sized arrays wont create a compile-time error in some cases >> starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced >> the error function attribute that

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: > On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: >> Negative sized arrays wont create a compile-time error in some cases >> starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced >> the error function attribute that

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Josh Triplett
On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: > Negative sized arrays wont create a compile-time error in some cases > starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced > the error function attribute that will. This patch modifies > BUILD_BUG_ON to behave

[PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This patch modifies BUILD_BUG_ON to behave like BUILD_BUG already does, using the error function attribute so that

[PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This patch modifies BUILD_BUG_ON to behave like BUILD_BUG already does, using the error function attribute so that

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Josh Triplett
On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This patch modifies BUILD_BUG_ON to behave like

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute that will. This

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Josh Triplett
On Fri, Sep 28, 2012 at 08:26:08PM -0500, Daniel Santos wrote: On 09/28/2012 07:32 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions),