[PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Feb 10 11:46:16 GMT 2022



On 10/02/2022 08:40, Adhemerval Zanella wrote:
> 
> 
> On 10/02/2022 08:31, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>>> The GCC error message doesn't suggest a strong preference either way:
>>>>
>>>> /tmp/t.c:1:1: error: static assertion failed: "failed"
>>>>     1 | _Static_assert (0, "failed");
>>>>       | ^~~~~~~~~~~~~~
>>>>
>>>> I think in the existing sources, the message is sometimes indicating the
>>>> failure, or what is being asserted (as is the case here).
>>>
>>> Compiler is will just emit the message if condition is met, my point is
>>> emitting 'CONSTANT_MINSIGSTKSZ is constant' on an error is the opposite
>>> of what triggered it (CONSTANT_MINSIGSTKSZ is really *not* a constant).
>>
>> But the check asserts that CONSTANT_MINSIGSTKSZ is constant, so the
>> message is still correct.
> In fact the _Static_assert does not really matter, __builtin_constant_p

_Static_assert message string*

> will already trigger a valid warning message:
> 
> In file included from ../include/features.h:490,
>                  from ../posix/sys/types.h:25,
>                  from ../include/sys/types.h:1,
>                  from ../include/string.h:6,
>                  from dl-support.c:22:
> ../sysdeps/unix/sysv/linux/dl-parse_auxv.h: In function ‘_dl_parse_auxv’:
> ../sysdeps/unix/sysv/linux/dl-parse_auxv.h:40:19: error: expression in static assertion is not constant
>    40 |   _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ),
>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../include/sys/cdefs.h:7:59: note: in definition of macro ‘_Static_assert’
>     7 | # define _Static_assert(expr, diagnostic) _Static_assert (expr, diagnostic)


More information about the Libc-alpha mailing list