handle label attributes
[smatch.git] / validation / preprocessor3.c
blob71b9acdef0414af10e2fa90f4f9126e3da1a958a
1 /*
2 * We get this one wrong too.
4 * It should result in a sequence
6 * B ( )
7 * A ( )
8 * B ( )
9 * A ( )
11 * because each iteration of the scanning of "SCAN()"
12 * should re-evaluate the recursive B->A->B expansion.
13 * But we never re-evaluate something that we noticed
14 * was recursive. So we will cause it to evaluate to
16 * B ( )
17 * A ( )
18 * A ( )
19 * A ( )
21 * Which is really quite wrong.
23 * Did I already mention that the C preprocessor language
24 * is a perverse thing?
27 #define LP (
29 #define A() B LP )
30 #define B() A LP )
32 #define SCAN(x) x
34 A() // B ( )
35 SCAN( A() ) // A ( )
36 SCAN(SCAN( A() )) // B ( )
37 SCAN(SCAN(SCAN( A() ))) // A ( )