File: warn_1_2.c

package info (click to toggle)
mcpp 2.7.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,024 kB
  • ctags: 29,151
  • sloc: ansic: 35,191; sh: 9,231; makefile: 176; cpp: 84; exp: 18
file content (20 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* warn_1_2.c   */

/*
 *   The following text is legal but suspicious one.  Good preprocessor
 * will warn at this text.
 */

/* { dg-do preprocess } */
/* { dg-options "-ansi -pedantic -Wall" }   */

/* w.1.2:   Rescanning of replacement text involves succeding text. */
#define sub( x, y)      (x - y)
#define head            sub(
    int     a = 1, b = 2, c;
    c = head a,b );             /* { dg-warning "involved subsequent text" "macro call involves subsequent text" }  */

#define OBJECT_LIKE     FUNCTION_LIKE
#define FUNCTION_LIKE( x, y)    (x + y)
    c = OBJECT_LIKE( a, b);     /* { dg-warning "involved subsequent text" "macro call involves subsequent text" }  */