[PATCH 2/3] gas/gen-sframe: avoid gcc extension using __VA_ARGS__
Jens Remus
jremus@linux.ibm.com
Mon Dec 8 10:08:37 GMT 2025
Hello Jan!
On 12/8/2025 8:27 AM, Jan Beulich wrote:
> On 05.12.2025 16:05, Jens Remus wrote:
>> On 12/5/2025 2:32 PM, Jan Beulich wrote:
>>> We shouldn't be using extensions when we don't have a suitable fallback in
>>> place. Introducing a format-argument-less counterpart macro would feel a
>>> little odd here. Instead make the sole use site have a (fake) argument
>>> (the non-translatable part of the string).
>>>
>>> --- a/gas/dw2gencfi.c
>>> +++ b/gas/dw2gencfi.c
>>> @@ -2622,7 +2622,7 @@ cfi_finish (void)
>>> #endif
>>> /* Avoid erroring with DEFAULT_SFRAME for non-default options, like
>>> -32 on x86_64. */
>>> - sframe_as_bad (_(".sframe not supported for target"));
>>> + sframe_as_bad (_("%s not supported for target"), ".sframe");
Maybe change as follows to ease grepping for the error message?
sframe_as_bad ("%s", _(".sframe not supported for target"));
>>
>> Couldn't this change be omitted, when changing the definition of
>> sframe_as_bad as follows?
>>
>>> }
>>>
>>> if ((all_cfi_sections & CFI_EMIT_debug_frame) != 0)
>>> --- a/gas/gen-sframe.h
>>> +++ b/gas/gen-sframe.h
>>> @@ -28,7 +28,7 @@
>>> #define sframe_as_bad(format, ...) \
>>
>> #define sframe_as_bad(...) \
>>
>>> do { \
>>> if (flag_gen_sframe == GEN_SFRAME_ENABLED) \
>>> - as_bad (format, ##__VA_ARGS__); \
>>> + as_bad (format, __VA_ARGS__); \
>>
>> as_bad (__VA_ARGS__); \
>>
>>> } while (0)
>>>
>>> #define SFRAME_FRE_ELEM_LOC_REG 0
>
> Yes, but see what you and I think about the similar aspect in objcopy.c. One
> of the problems with this form is that the macro then also permits for no
> arguments at all. Sure, the compiler will flag a missing argument to as_bad()
> then, but still.
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
More information about the Binutils
mailing list