OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [tr-warn2.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* K+R rejects use of function-like macros in non-function context.
2
   ANSI C explicitly permits this (the macro is not expanded).
3
 
4
   We should not warn about this during pre-expansion of arguments,
5
   since traditional preprocessors don't do pre-expansion, and we get
6
   the warning anyway during the re-scan pass if and only if it is
7
   appropriate.  */
8
 
9
/* { dg-do preprocess } */
10
/* { dg-options -Wtraditional } */
11
 
12
#define f(x) x
13
#define g(x) x / 2
14
#define h(a, b) a(b)
15
f(g) (3)            /* { dg-bogus "must be used with arguments" } */
16
f 2                 /* { dg-warning "must be used with arguments" } */
17
f(g) 3              /* { dg-warning "must be used with arguments" } */
18
h(f, 3)             /* { dg-bogus "must be used with arguments" } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.