[PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing
Adhemerval Zanella
adhemerval.zanella@linaro.org
Thu Feb 10 11:29:11 GMT 2022
On 10/02/2022 07:54, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>>>>> + auxv_values[AT_PAGESZ] = EXEC_PAGESIZE;
>>>>> + auxv_values[AT_FPUCW] = _FPU_DEFAULT;
>>>>> +
>>>>> + /* NB: Default to a constant CONSTANT_MINSIGSTKSZ. */
>>>>> + _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ),
>>>>> + "CONSTANT_MINSIGSTKSZ is constant");
>>>>
>>>> Shouldn't it warn that CONSTANT_MINSIGSTKSZ is not a constant?
>>>
>>> Sorry, would please rephrase? Should I change this to
>>> ""CONSTANT_MINSIGSTKSZ is not constant"?
>>
>> Yeah because on a the _Static_assert failure the resulting message seems
>> to the opposite of what triggered it.
>
> 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).
More information about the Libc-alpha
mailing list