[PATCH] gprofng: protect against standard library macros
Sam James
sam@gentoo.org
Wed Feb 11 01:32:17 GMT 2026
Claudiu Zissulescu Ianculescu <claziss@gmail.com> writes:
> Hi Andreas,
Andreas, could you check it in (and put it on the branch)?
>
> LGTM,
> Claudiu
>
> On Mon, Nov 24, 2025 at 12:11 PM Andreas Schwab <schwab@suse.de> wrote:
>>
>> The CALL_UTIL macro can expand to an unparsable expression of the argument
>> is a macro, like with the new const-preserving standard library macros in
>> C23.
>>
>> * gprofng/src/collector_module.h (CALL_UTIL): Add parens to not
>> expand its argument if it is a function-like macro.
>> ---
>> gprofng/src/collector_module.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gprofng/src/collector_module.h b/gprofng/src/collector_module.h
>> index b64d69c45ab..859a6dd1f7d 100644
>> --- a/gprofng/src/collector_module.h
>> +++ b/gprofng/src/collector_module.h
>> @@ -119,7 +119,7 @@ typedef struct CollectorUtilFuncs
>> extern CollectorUtilFuncs __collector_util_funcs;
>> extern int __collector_dlsym_guard;
>>
>> -#define CALL_UTIL(x) __collector_util_funcs.x
>> +#define CALL_UTIL(x) (__collector_util_funcs.x)
>>
>> /* The following constants define the meaning of the "void *arg"
>> * argument of getFrameInfo().
>> --
>> 2.52.0
>>
>>
>> --
>> Andreas Schwab, SUSE Labs, schwab@suse.de
>> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
>> "And now for something completely different."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 418 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260211/fb733b30/attachment.sig>
More information about the Binutils
mailing list