Re: BUILD_BUG_ON_MSG

2018-04-15 Thread Julia Lawall
On Sun, 15 Apr 2018, Daniel Santos wrote: > Hello Julia, > > I'm CCing LKML on this so that others can be involved. > > > On 04/15/2018 12:43 AM, Julia Lawall wrote: > > Hello, > > > > I saw that you introduced BUILD_BUG_ON_MSG in the Linux kernel a fe

Re: BUILD_BUG_ON_MSG

2018-04-15 Thread Daniel Santos
Hello Julia, I'm CCing LKML on this so that others can be involved. On 04/15/2018 12:43 AM, Julia Lawall wrote: > Hello, > > I saw that you introduced BUILD_BUG_ON_MSG in the Linux kernel a few years > ago. > > BUILD_BUG_ON_MSG is not safe when used in header files. V

Re: [V2] arch/powerpc: use BUILD_BUG_ON_MSG() when detect unfit {cmp}xchg size

2016-02-29 Thread Michael Ellerman
On Tue, 2016-23-02 at 11:05:01 UTC, xinhui wrote: > From: pan xinhui > > __xchg_called_with_bad_pointer() can't tell us what codes use {cmp}xchg > in incorrect way. And no error will be reported until the link stage. > To fix such a kind of issues easily, we use BUI

[PATCH V2] arch/powerpc: use BUILD_BUG_ON_MSG() when detect unfit {cmp}xchg size

2016-02-23 Thread Pan Xinhui
From: pan xinhui __xchg_called_with_bad_pointer() can't tell us what codes use {cmp}xchg in incorrect way. And no error will be reported until the link stage. To fix such a kind of issues easily, we use BUILD_BUG_ON_MSG() here. Signed-off-by: pan xinhui --- change from V1:

[PATCH V2] arch/powerpc: use BUILD_BUG_ON_MSG() when detect unfit {cmp}xchg size

2016-02-23 Thread Pan Xinhui
From: pan xinhui __xchg_called_with_bad_pointer() can't tell us what codes use {cmp}xchg in incorrect way. And no error will be reported until the link stage. To fix such a kind of issues easily, we use BUILD_BUG_ON_MSG() here. Signed-off-by: pan xinhui --- change from V1:

[PATCH v8 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2013-01-01 Thread danielfsantos
supplied condition is *false*. Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps compiletime_assert, inverting the logic, so that it fails when the condition is *true*, consistent with the language "build bug on." This macro allows you to specify the error message you want emitte

[PATCH v7 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2013-01-01 Thread danielfsantos
supplied condition is *false*. Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps compiletime_assert, inverting the logic, so that it fails when the condition is *true*, consistent with the language "build bug on." This macro allows you to specify the error message you want emitte

[PATCH v6 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2012-11-20 Thread danielfsantos
supplied condition is *false*. Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps compiletime_assert, inverting the logic, so that it fails when the condition is *true*, consistent with the language "build bug on." This macro allows you to specify the error message you want emitte

Re: [PATCH v5 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2012-11-16 Thread Daniel Santos
On 11/13/2012 04:13 PM, danielfsan...@att.net wrote: > +#define __compiletime_assert(condition, msg, __func) \ > + do {\ > + bool __cond = !(condition); \ > + extern v

Re: [PATCH v5 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2012-11-15 Thread Borislav Petkov
of > the POSIX assert macro, compiletime_assert creates a build-time error > when the supplied condition is *false*. > > Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps > compiletime_assert, inverting the logic, so that it fails when the > condition is *true*, consistie

[PATCH v5 9/9] bug.h, compiler.h: Introduce compiletime_assert & BUILD_BUG_ON_MSG

2012-11-13 Thread danielfsantos
supplied condition is *false*. Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps compiletime_assert, inverting the logic, so that it fails when the condition is *true*, consistient with the language "build bug on." This macro allows you to specify the error message you want emitte

Re: [PATCH v4 9/9] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-30 Thread Daniel Santos
On 10/30/2012 08:02 PM, Josh Triplett wrote: > On Tue, Oct 30, 2012 at 08:19:05PM +0100, Borislav Petkov wrote: >> On Sun, Oct 28, 2012 at 03:57:15PM -0500, danielfsan...@att.net wrote: >>> Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just >>> call

Re: [PATCH v4 9/9] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-30 Thread Josh Triplett
On Tue, Oct 30, 2012 at 08:19:05PM +0100, Borislav Petkov wrote: > On Sun, Oct 28, 2012 at 03:57:15PM -0500, danielfsan...@att.net wrote: > > Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just > > call BUILD_BUG_ON_MSG. This not only reduces source code bloa

Re: [PATCH v4 8/9] bug.h: Add BUILD_BUG_ON_MSG & _BUILD_BUG_INTERNAL

2012-10-30 Thread Borislav Petkov
On Tue, Oct 30, 2012 at 06:17:47PM +0100, Borislav Petkov wrote: > can BUILD_BUG_ON and BUILD_BUG_ON_MSG both use __BUILD_BUG_INTERNAL? > > In the BUILD_BUG_ON msg will be "BUILD_BUG_ON failed" and line empty. > Can that even work? Yes it can, I should simply l

Re: [PATCH v4 9/9] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-30 Thread Borislav Petkov
On Sun, Oct 28, 2012 at 03:57:15PM -0500, danielfsan...@att.net wrote: > Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just > call BUILD_BUG_ON_MSG. This not only reduces source code bloat, but > also prevents the possibility of code being changed for one macro and

Re: [PATCH v4 8/9] bug.h: Add BUILD_BUG_ON_MSG & _BUILD_BUG_INTERNAL

2012-10-30 Thread Borislav Petkov
On Sun, Oct 28, 2012 at 03:57:14PM -0500, danielfsan...@att.net wrote: > Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations > enabled), except that it allows you to specify the error message you > want emitted as the third parameter. Under the hood, this

[PATCH v4 8/9] bug.h: Add BUILD_BUG_ON_MSG & _BUILD_BUG_INTERNAL

2012-10-28 Thread danielfsantos
Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations enabled), except that it allows you to specify the error message you want emitted as the third parameter. Under the hood, this relies on _BUILD_BUG_INTERNAL, which does the actual work and is pretty-much identical to

[PATCH v4 9/9] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-28 Thread danielfsantos
Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just call BUILD_BUG_ON_MSG. This not only reduces source code bloat, but also prevents the possibility of code being changed for one macro and not for the other (which was previously the case for BUILD_BUG and BUILD_BUG_ON

[PATCH v3 09/10] bug.h: Add BUILD_BUG_ON_MSG & _BUILD_BUG_INTERNAL

2012-10-24 Thread danielfsantos
Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations enabled), except that it allows you to specify the error message you want emitted as the third parameter. Under the hood, this relies on _BUILD_BUG_INTERNAL, which does the actual work and is pretty-much identical to

[PATCH v3 10/10] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-24 Thread danielfsantos
Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just call BUILD_BUG_ON_MSG. This not only reduces source code bloat, but also prevents the possibility of code being changed for one macro and not for the other (which was previously the case for BUILD_BUG and BUILD_BUG_ON

Re: [PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG & BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread Daniel Santos
On 10/05/2012 04:02 PM, Josh Triplett wrote: > On Fri, Oct 05, 2012 at 10:58:58PM +0200, Borislav Petkov wrote: >> On Fri, Oct 05, 2012 at 02:42:48PM -0500, danielfsan...@att.net wrote: >>> Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations >>> turn

Re: [PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG & BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread Steven Rostedt
On Fri, 2012-10-05 at 22:58 +0200, Borislav Petkov wrote: > On Fri, Oct 05, 2012 at 02:42:48PM -0500, danielfsan...@att.net wrote: > > Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations > > turned enabled), except that it allows you to specify the error messa

Re: [PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG & BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread Josh Triplett
On Fri, Oct 05, 2012 at 10:58:58PM +0200, Borislav Petkov wrote: > On Fri, Oct 05, 2012 at 02:42:48PM -0500, danielfsan...@att.net wrote: > > Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations > > turned enabled), except that it allows you to specify the error

Re: [PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG & BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread Borislav Petkov
On Fri, Oct 05, 2012 at 02:42:48PM -0500, danielfsan...@att.net wrote: > Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations > turned enabled), except that it allows you to specify the error message > you want emitted as the third parameter. Under the hood, this

[PATCH v2 10/10] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-05 Thread danielfsantos
Remove duplicate code by converting BUILD_BUG and BUILD_BUG_ON to just call BUILD_BUG_ON_MSG. This not only reduces source code bloat, but also prevents the possibility of code being changed for one macro and not for the other (which was previously the case for BUILD_BUG and BUILD_BUG_ON

[PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG & BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread danielfsantos
Add BUILD_BUG_ON_MSG which behaves like BUILD_BUG_ON (with optimizations turned enabled), except that it allows you to specify the error message you want emitted as the third parameter. Under the hood, this relies on BUILD_BUG_INTERNAL{,2}, which does the actual work and is pretty-much identical