Blame cpp-test/test-t/warn_1_2.c

Packit b40e2e
/* warn_1_2.c   */
Packit b40e2e
Packit b40e2e
/*
Packit b40e2e
 *   The following text is legal but suspicious one.  Good preprocessor
Packit b40e2e
 * will warn at this text.
Packit b40e2e
 */
Packit b40e2e
Packit b40e2e
/* { dg-do preprocess } */
Packit b40e2e
/* { dg-options "-ansi -pedantic -Wall" }   */
Packit b40e2e
Packit b40e2e
/* w.1.2:   Rescanning of replacement text involves succeding text. */
Packit b40e2e
#define sub( x, y)      (x - y)
Packit b40e2e
#define head            sub(
Packit b40e2e
    int     a = 1, b = 2, c;
Packit b40e2e
    c = head a,b );             /* { dg-warning "involved subsequent text" "macro call involves subsequent text" }  */
Packit b40e2e
Packit b40e2e
#define OBJECT_LIKE     FUNCTION_LIKE
Packit b40e2e
#define FUNCTION_LIKE( x, y)    (x + y)
Packit b40e2e
    c = OBJECT_LIKE( a, b);     /* { dg-warning "involved subsequent text" "macro call involves subsequent text" }  */
Packit b40e2e