http://llvm.org/bugs/show_bug.cgi?id=6084

           Summary: Clang allows function-like macro argument lists to span
                    files
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


blackthorn:clang dgregor$ cat t.h
#define FOO(X, Y) X + Y

int add() { return FOO(17, 
blackthorn:clang dgregor$ cat t.c
#include "t.h"

17); }


blackthorn:clang dgregor$ clang -fsyntax-only t.c
blackthorn:clang dgregor$ gcc -fsyntax-only t.c
In file included from t.c:1:
t.h:3:1: error: unterminated argument list invoking macro "FOO"
t.c: In function ‘add’:
t.h:3: error: ‘FOO’ undeclared (first use in this function)
t.h:3: error: (Each undeclared identifier is reported only once
t.h:3: error: for each function it appears in.)
t.c:3: error: expected ‘;’ before numeric constant
t.c:3: error: expected statement before ‘)’ token


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to