fix -Werror regressions with gcc 4.8 on x86_64
Paul Eggert
eggert@cs.ucla.edu
Tue Jan 6 17:26:00 GMT 2015
On 01/06/2015 08:35 AM, Richard Henderson wrote:
> I do wonder about the public header file using an expression like
>
> __ASSERT_VOID_CAST (0 && (expr))
>
> Side effects are not evaluated, but identifiers referenced in the expression
> still get marked as "used", etc.
Just as a heads-up, the GNU Emacs internals have a macro 'eassert' that
does that, and it works well; we prefer it to 'assert'. There's also a
macro 'eassume' that uses __builtin_unreachable; we tried having eassert
do that too, but it led to too many compile-time false-alarms.
However, the C Standard doesn't allow eassert's implementation 'assert',
as it requires that if NDEBUG is defined, then 'assert' must be defined
via '#define assert(x) ((void)0)', which means weird uses like
'assert(***)' have to work.
Perhaps the public header file could use '0 && (expr)' only when in
standards-conforming mode?
More information about the Libc-alpha
mailing list