| Message ID | 67dab3f1-4b3f-41b0-b873-86900f28da57@suse.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A6D54CCCA25 for <patchwork@sourceware.org>; Fri, 5 Dec 2025 13:35:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A6D54CCCA25 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=ffbvUhWf X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by sourceware.org (Postfix) with ESMTPS id 5776A4BA23F9 for <binutils@sourceware.org>; Fri, 5 Dec 2025 13:33:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5776A4BA23F9 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5776A4BA23F9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764941587; cv=none; b=ksfEdPf7U/IkYJ8B9S9WSOPXy15fEkOKFxlb5MlviZz4uejT44gdO71L0UGEih5aCjzYG2mlwLw7EuTqHYc/qsocTT623plCoIr2+bvngD8CxR7lGv5cLyenS3MmRUCmakDhZ47zbXOVcgr7eDTu0O7724BFxcKMwx6HKclt+dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764941587; c=relaxed/simple; bh=YStlrRgs4GJM3hKZlcGrgNoMibRaBNkqCB/q07lpz7Y=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=sqfIHs+X7S+8jwkdITj4IjXxhWZ3wDwnx0eNAIUKOMznlPO0AmVuoH3PXmSp8/PHrIQMkSMXTDZkl64AZJJUkLzKnkDymMKvz5wAB9gzkGjeZrmhl2oqESS6wliXwBm6ifOvpjxHYD5wBHVmTcjLUQjuYfURKazer5MTiCS1/rc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5776A4BA23F9 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47775fb6cb4so17170375e9.0 for <binutils@sourceware.org>; Fri, 05 Dec 2025 05:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1764941581; x=1765546381; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=ysYRJ4woJmvESnq/wj2MfsN/me3/kd0nZNwa/m1o8bM=; b=ffbvUhWfP3aaUV3zgUFkNepJE8zBclBLWTdlfW0/3JsFEZFsNZGYDr0Z52MTQ3DgyE hNMRhO07i2icqL0kg+eg/FUJ94Jzsd77rd/6MwekD3rS2rg4fyKIUWNsCnGHqVexeWRJ 4NqGnRqxbo6+a7Rb2QUyML6C+auPcOOibghuO7khMLsOghp89ek22i6lXmOpeIgXVPCa 8QyBWQ3nV1hFCOCJr+hQearvbx2JFqHC+1l20MIsN10fkHI5WPs3oS+6yFvVRRfXyDwd PDUwFZan4DCMrvBlyANUFLTG8kSENlPy5Q62J48bInO2qWCGa+Cyt1Vn5AwD5pGztJRm GLYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764941581; x=1765546381; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject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qnxPVIP16g== X-Google-Smtp-Source: AGHT+IEalnbXR103/CeZKAcFlVZ3onZUlnBih536eHsAlDSzrHyGZJ+K7DSSeG4UjSBOmEedj8Y6aw== X-Received: by 2002:a05:600c:1c9a:b0:477:54cd:202e with SMTP id 5b1f17b1804b1-4792aed9fdfmr112698605e9.2.1764941581287; Fri, 05 Dec 2025 05:33:01 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792b02e84dsm59645585e9.4.2025.12.05.05.33.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Dec 2025 05:33:00 -0800 (PST) Message-ID: <67dab3f1-4b3f-41b0-b873-86900f28da57@suse.com> Date: Fri, 5 Dec 2025 14:32:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/3] gas/gen-sframe: avoid gcc extension using __VA_ARGS__ From: Jan Beulich <jbeulich@suse.com> To: Binutils <binutils@sourceware.org> Cc: Indu Bhagat <indu.bhagat@oracle.com> References: <46d6ae17-f6d2-4e5b-a802-c6895a095d3b@suse.com> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOV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CGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <46d6ae17-f6d2-4e5b-a802-c6895a095d3b@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3018.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
avoid gcc extension using __VA_ARGS__
|
|
Commit Message
Jan Beulich
Dec. 5, 2025, 1:32 p.m. UTC
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).
Comments
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"); 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 > IIRC this is how Indu resolved a similar case in libsframe. Regards, Jens
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"); > > 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. Jan
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
On 08.12.2025 11:08, Jens Remus wrote: > 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")); Possible as well. I actually like pulling out the non-translatable directive, but I also can see your point about grep-ability (which would go away though anyway if true parametrization would be necessary). Indu's call, in the end. Jan
On 12/8/25 2:16 AM, Jan Beulich wrote: > On 08.12.2025 11:08, Jens Remus wrote: >> 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")); > > Possible as well. I actually like pulling out the non-translatable directive, > but I also can see your point about grep-ability (which would go away though > anyway if true parametrization would be necessary). Indu's call, in the end. > I think sframe_as_bad ("%s", _(".sframe not supported for target")); may be slightly better. We may have a usecase for sframe_as_warn () later. There may not be a clear non-translatable subset of the string in some cases for sframe_as_warn () like: as_warn (_("no SFrame FDE emitted; XYZ")); In which case, switching over to: sframe_as_warn ("%s", _("no SFrame FDE emitted; XYZ")); will at least look more homogeneous (and grep-ability is not adversely affected). Thanks for taking care of this, Indu
On 08.12.2025 19:56, Indu Bhagat wrote: > On 12/8/25 2:16 AM, Jan Beulich wrote: >> On 08.12.2025 11:08, Jens Remus wrote: >>> 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")); >> >> Possible as well. I actually like pulling out the non-translatable directive, >> but I also can see your point about grep-ability (which would go away though >> anyway if true parametrization would be necessary). Indu's call, in the end. >> > > I think sframe_as_bad ("%s", _(".sframe not supported for target")); may > be slightly better. We may have a usecase for sframe_as_warn () later. > There may not be a clear non-translatable subset of the string in some > cases for sframe_as_warn () like: > as_warn (_("no SFrame FDE emitted; XYZ")); > > In which case, switching over to: > sframe_as_warn ("%s", _("no SFrame FDE emitted; XYZ")); > > will at least look more homogeneous (and grep-ability is not adversely > affected). If the XYZ is intended to vary, an alternative (saving on consumed .rodata space) might be sframe_as_warn (_("no SFrame FDE emitted; %s), _("XYZ")); And in any event, if the argument-less pattern was to occur more frequently, I would anyway prefer to introduce a 2nd macro along the lines of what patch 1 here does, e.g. sframe_as_bad0() / sframe_as_warn0(). Thoughts? (Ftaod, unless I hear otherwise, I'll switch as you request above for the patch here and commit presumably by the end of the week. The aspects discussed can easily be addressed later on.) Jan
On 12/8/25 11:23 PM, Jan Beulich wrote: > On 08.12.2025 19:56, Indu Bhagat wrote: >> On 12/8/25 2:16 AM, Jan Beulich wrote: >>> On 08.12.2025 11:08, Jens Remus wrote: >>>> 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")); >>> >>> Possible as well. I actually like pulling out the non-translatable directive, >>> but I also can see your point about grep-ability (which would go away though >>> anyway if true parametrization would be necessary). Indu's call, in the end. >>> >> >> I think sframe_as_bad ("%s", _(".sframe not supported for target")); may >> be slightly better. We may have a usecase for sframe_as_warn () later. >> There may not be a clear non-translatable subset of the string in some >> cases for sframe_as_warn () like: >> as_warn (_("no SFrame FDE emitted; XYZ")); >> >> In which case, switching over to: >> sframe_as_warn ("%s", _("no SFrame FDE emitted; XYZ")); >> >> will at least look more homogeneous (and grep-ability is not adversely >> affected). > > If the XYZ is intended to vary, an alternative (saving on consumed .rodata > space) might be > > sframe_as_warn (_("no SFrame FDE emitted; %s), _("XYZ")); > > And in any event, if the argument-less pattern was to occur more frequently, > I would anyway prefer to introduce a 2nd macro along the lines of what patch > 1 here does, e.g. sframe_as_bad0() / sframe_as_warn0(). > OK. > Thoughts? (Ftaod, unless I hear otherwise, I'll switch as you request above > for the patch here and commit presumably by the end of the week. The aspects > discussed can easily be addressed later on.) > Sounds reasonable to me. Thanks
--- 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"); } 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, ...) \ do { \ if (flag_gen_sframe == GEN_SFRAME_ENABLED) \ - as_bad (format, ##__VA_ARGS__); \ + as_bad (format, __VA_ARGS__); \ } while (0) #define SFRAME_FRE_ELEM_LOC_REG 0