[LLVMbugs] [Bug 12146] New: clang's NULL definition in stddef.h clashes with msvc's crtdefs.h

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 29 18:13:48 PST 2012


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

             Bug #: 12146
           Summary: clang's NULL definition in stddef.h clashes with
                    msvc's crtdefs.h
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Headers
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Compiling

#include <stddef.h>
#include <crtdefs.h>
int* a = NULL

without -nobuiltininc yields:

test.cc:5:16: error: expected expression
int* a = __null;


That's because clang's stddef.h defines NULL to __null, but crtdefs.h
apparently defines __null to something else.


Not sure what the right fix is. Make __clang_null an alternate spelling of
__null and define NULL to __clang_null in stddef.h?

-- 
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