OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [tr-warn2.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* 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.