1 #define MY_MACRO(a) do { \
2 __builtin_warning(!__builtin_safe_p(a), "Macro argument with side effects: " #a); \
7 int h(int) __attribute__((pure
));
8 int i(int) __attribute__((const));
10 static int foo(int x
, int y
)
28 * check-name: __builtin_safe
30 builtin_safe1.c:13:3: warning: Macro argument with side effects: x++
31 builtin_safe1.c:14:3: warning: Macro argument with side effects: x+=1
32 builtin_safe1.c:15:3: warning: Macro argument with side effects: x=x+1
33 builtin_safe1.c:16:3: warning: Macro argument with side effects: x%=y
34 builtin_safe1.c:17:3: warning: Macro argument with side effects: x=y
35 builtin_safe1.c:18:3: warning: Macro argument with side effects: g(x)
36 builtin_safe1.c:19:3: warning: Macro argument with side effects: (y,g(x))