Skip to content

Preprocessor hangs on an example from the C standard #30

@alexfru

Description

@alexfru
#define x    3
#define f(a) f(x * (a))
#undef  x
#define x    2
#define g    f
#define z    z[0]
#define h    g(~
#define m(a) a(w)
#define w    0,1
#define t(a) a

f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w) | h 5) & m
         (f)^m(m);

/* expected: */
/*
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
*/

Reproducible with the preprocessor compiled with Open Watcom C/C++ 1.9, MinGW 4.8.2, my Smaller C and run on Windows 7 x64. Also reproducible with the preprocessor compiled with gcc 4.6.3 on Ubuntu 12.04LTS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions