annotate gcc/testsuite/gcc.dg/cpp/tr-warn2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
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" } */