Thread (29 messages) flat view 29 messages, 9 authors, 2017-02-02

Build failure with v4.9-rc1 and GCC trunk -- compiler weirdness

From: joe@perches.com (Joe Perches)
Date: 2017-02-01 20:34:09
Also in: lkml

On Wed, 2017-02-01 at 19:53 +0000, Ard Biesheuvel wrote:
On 1 February 2017 at 19:49, Joe Perches [off-list ref] wrote:
[]
quoted
Or maybe add a BUILD_BUG_ON something like:

#define order_base_2(n)                                                 \
({                                                                      \
        typeof(n) _n = n;                                               \
        BUILD_BUG_ON(__builtin_constant_p(_n) && _n < 0);               \
        __builtin_constant_p(_n) ? (_n < 2 ? _n : ilog2((_n) - 1) + 1)) \
                                 : __order_base_2(_n);                  \
})
This would interfere with the ability to use order_base_2() in
initializers for global variables.
There aren't any as far as I can tell and would using
order_base_2() for a global initializer make sense?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help