annotate gcc/testsuite/gcc.dg/cpp/tr-warn2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* K+R rejects use of function-like macros in non-function context.
kono
parents:
diff changeset
2 ANSI C explicitly permits this (the macro is not expanded).
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 We should not warn about this during pre-expansion of arguments,
kono
parents:
diff changeset
5 since traditional preprocessors don't do pre-expansion, and we get
kono
parents:
diff changeset
6 the warning anyway during the re-scan pass if and only if it is
kono
parents:
diff changeset
7 appropriate. */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 /* { dg-do preprocess } */
kono
parents:
diff changeset
10 /* { dg-options -Wtraditional } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 #define f(x) x
kono
parents:
diff changeset
13 #define g(x) x / 2
kono
parents:
diff changeset
14 #define h(a, b) a(b)
kono
parents:
diff changeset
15 f(g) (3) /* { dg-bogus "must be used with arguments" } */
kono
parents:
diff changeset
16 f 2 /* { dg-warning "must be used with arguments" } */
kono
parents:
diff changeset
17 f(g) 3 /* { dg-warning "must be used with arguments" } */
kono
parents:
diff changeset
18 h(f, 3) /* { dg-bogus "must be used with arguments" } */