[LLVMbugs] [Bug 6084] New: Clang allows function-like macro argument lists to span files

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jan 19 11:19:12 PST 2010


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: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list