On 12.05.2025 14:09, Andrew Cooper wrote:
> On 12/05/2025 12:59 pm, Jan Beulich wrote:
>> On 05.05.2025 21:44, Stefano Stabellini wrote:
>>> On Mon, 5 May 2025, Andrew Cooper wrote:
>>>> In macros it is common to declare local variables using typeof(param) in 
>>>> order
>>>> to ensure that side effects are only evaluated once.  A consequence of 
>>>> this is
>>>> double textural expansion of the parameter, which can get out of hand very
>>>> quickly with nested macros.
>>>>
>>>> A GCC extension, __auto_type, is now avaialble in the new toolchain 
>>>> baseline
>>>> and avoids the double textural expansion.
>>> I think this is a good change
>> +1
> 
> That looks like agreement.
> 
> Now for the (new) controversial part.  Since sending this, Linux has
> decided to just #define auto __auto_type for C < 23, in order to start
> writing C23 compatible code from now.  It's more succinct, and has
> better longevity.
> 
> We might want to consider the same, although it will introduce a new
> example of defining a keyword, which we'd have to call out in the
> MISRA/Eclair config.

I'm not outright opposed, as I don't think we use "auto" with its
original semantics, but it feels somewhat odd.

Jan

Reply via email to