]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gprofng: protect against standard library macros
authorAndreas Schwab <schwab@suse.de>
Sat, 22 Nov 2025 10:29:43 +0000 (11:29 +0100)
committerAndreas Schwab <schwab@suse.de>
Fri, 28 Nov 2025 20:46:04 +0000 (21:46 +0100)
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

index b64d69c45ab6ef2f11873f1a907c6b213122de55..859a6dd1f7d7ad601e3bdb053b6f946683be7dd0 100644 (file)
@@ -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().