Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-25 Thread Masahiro Yamada
Hi Daniel, 2018-08-21 17:11 GMT+09:00 Daniel Santos : > On 08/19/2018 03:25 PM, Nick Desaulniers wrote: >> + gbiv who wrote this cool paste (showing alternatives to >> _Static_assert, which is supported by both compilers in -std=gnu89, >> but not until gcc 4.6): https://godbolt.org/g/DuLsxu >>

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-25 Thread Masahiro Yamada
Hi Daniel, 2018-08-21 17:11 GMT+09:00 Daniel Santos : > On 08/19/2018 03:25 PM, Nick Desaulniers wrote: >> + gbiv who wrote this cool paste (showing alternatives to >> _Static_assert, which is supported by both compilers in -std=gnu89, >> but not until gcc 4.6): https://godbolt.org/g/DuLsxu >>

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Kees Cook
On Tue, Aug 21, 2018 at 9:15 AM, Masahiro Yamada wrote: >> Note that there are a few definitions of BUILD_BUG_ON that still use >> this negative array size trick. Should that pattern be removed from >> them as well? See: >> * arch/x86/boot/boot.h#L33 >> * include/linux/build_bug.h#L66 >> *

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Kees Cook
On Tue, Aug 21, 2018 at 9:15 AM, Masahiro Yamada wrote: >> Note that there are a few definitions of BUILD_BUG_ON that still use >> this negative array size trick. Should that pattern be removed from >> them as well? See: >> * arch/x86/boot/boot.h#L33 >> * include/linux/build_bug.h#L66 >> *

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Masahiro Yamada
Hi Nick, 2018-08-20 5:25 GMT+09:00 Nick Desaulniers : > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG should

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Masahiro Yamada
Hi Nick, 2018-08-20 5:25 GMT+09:00 Nick Desaulniers : > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG should

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Daniel Santos
On 08/19/2018 03:25 PM, Nick Desaulniers wrote: > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG should use >

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-21 Thread Daniel Santos
On 08/19/2018 03:25 PM, Nick Desaulniers wrote: > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG should use >

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Linus Torvalds
On Sun, Aug 19, 2018 at 1:36 PM Nick Desaulniers wrote: > > On Sun, Aug 19, 2018 at 1:28 PM Linus Torvalds > wrote: > > > > Well, it turns out that we effectively stopped supporting gcc < 4.6 > > during this merge window for other reasons, so.. > > For the whole kernel (or just a particular

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Linus Torvalds
On Sun, Aug 19, 2018 at 1:36 PM Nick Desaulniers wrote: > > On Sun, Aug 19, 2018 at 1:28 PM Linus Torvalds > wrote: > > > > Well, it turns out that we effectively stopped supporting gcc < 4.6 > > during this merge window for other reasons, so.. > > For the whole kernel (or just a particular

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Nick Desaulniers
On Sun, Aug 19, 2018 at 1:28 PM Linus Torvalds wrote: > > On Sun, Aug 19, 2018 at 1:25 PM Nick Desaulniers > wrote: > > > > + gbiv who wrote this cool paste (showing alternatives to > > _Static_assert, which is supported by both compilers in -std=gnu89, > > but not until gcc 4.6):

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Nick Desaulniers
On Sun, Aug 19, 2018 at 1:28 PM Linus Torvalds wrote: > > On Sun, Aug 19, 2018 at 1:25 PM Nick Desaulniers > wrote: > > > > + gbiv who wrote this cool paste (showing alternatives to > > _Static_assert, which is supported by both compilers in -std=gnu89, > > but not until gcc 4.6):

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Linus Torvalds
On Sun, Aug 19, 2018 at 1:25 PM Nick Desaulniers wrote: > > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Linus Torvalds
On Sun, Aug 19, 2018 at 1:25 PM Nick Desaulniers wrote: > > + gbiv who wrote this cool paste (showing alternatives to > _Static_assert, which is supported by both compilers in -std=gnu89, > but not until gcc 4.6): https://godbolt.org/g/DuLsxu > > I can't help but think that BUILD_BUG_ON_MSG

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Nick Desaulniers
+ gbiv who wrote this cool paste (showing alternatives to _Static_assert, which is supported by both compilers in -std=gnu89, but not until gcc 4.6): https://godbolt.org/g/DuLsxu I can't help but think that BUILD_BUG_ON_MSG should use _Static_assert, then have fallbacks for gcc < 4.6. On Sun,

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Nick Desaulniers
+ gbiv who wrote this cool paste (showing alternatives to _Static_assert, which is supported by both compilers in -std=gnu89, but not until gcc 4.6): https://godbolt.org/g/DuLsxu I can't help but think that BUILD_BUG_ON_MSG should use _Static_assert, then have fallbacks for gcc < 4.6. On Sun,

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Kees Cook
On Sat, Aug 18, 2018 at 10:51 PM, Masahiro Yamada wrote: > __compiletime_assert_fallback() is supposed to stop building earlier > by using the negative-array-size method in case the compiler does not > support "error" attribute, but has never worked like that. > > You can try this simple code: >

Re: [RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-19 Thread Kees Cook
On Sat, Aug 18, 2018 at 10:51 PM, Masahiro Yamada wrote: > __compiletime_assert_fallback() is supposed to stop building earlier > by using the negative-array-size method in case the compiler does not > support "error" attribute, but has never worked like that. > > You can try this simple code: >

[RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-18 Thread Masahiro Yamada
__compiletime_assert_fallback() is supposed to stop building earlier by using the negative-array-size method in case the compiler does not support "error" attribute, but has never worked like that. You can try this simple code: #include void foo(void) { BUILD_BUG_ON(1);

[RFC PATCH] compiler.h: give up __compiletime_assert_fallback()

2018-08-18 Thread Masahiro Yamada
__compiletime_assert_fallback() is supposed to stop building earlier by using the negative-array-size method in case the compiler does not support "error" attribute, but has never worked like that. You can try this simple code: #include void foo(void) { BUILD_BUG_ON(1);