SVN trunk Build issue on Windows


When building a fresh LLVM and Clang (both SVN r151358) I get following build failure:

M:\Development\Source\LLVM\tools\clang\lib\AST\Decl.cpp: In member function ‘unsigned int clang::FunctionDecl::getMemoryFunctionKind() const’:
M:\Development\Source\LLVM\tools\clang\lib\AST\Decl.cpp:2406:8: error: ‘BIstrncasecmp’ is not a member of ‘clang::Builtin’
M:\Development\Source\LLVM\tools\clang\lib\AST\Decl.cpp:2407:12: error: ‘BIstrncasecmp’ is not a member of ‘clang::Builtin’
M:\Development\Source\LLVM\tools\clang\lib\AST\Decl.cpp:2437:16: error: ‘BIstrncasecmp’ is not a member of ‘clang::Builtin’

Does anyone know what went wrong? I tried a clean rebuild twice.



mingw32-make clang (r151358) finished without errors for me.

I have localized the problem: MinGW-w64 trunk (not the stable branch) defines strncasecmp as a macro, making Clang’s builtin declarations faulty. I can resolve the build error by adding an “#undef strncasecmp” (like the “#undef setjmp” in the same file) to builtins.def, but before submitting a patch I contacted the MinGW-w64 devs to see if the problem cannot be resolved on their end, as this would be the only platform the undef does anything.

I’ll submit a patch for Clang if MinGW-w64’s macro is deemed necessary.


2012/2/24 Nikola Smiljanic <>