I'm trying to build clang with gcc trunk on Mac OS X: gcc version 4.4.0 20080310 (experimental) [trunk revision 133080] (GCC)
I'm not sure if it's more strict, or the libstdc++ headers have changed, or what, but the following errors occur:
llvm[1]: Compiling Diagnostic.cpp for Debug-Asserts buildDiagnostic.cpp: In constructor 'clang::Diagnostic::Diagnostic(clang::DiagnosticClient&)':
Diagnostic.cpp:114: error: 'memset' was not declared in this scope ... llvm[1]: Compiling ScratchBuffer.cpp for Debug-Asserts buildScratchBuffer.cpp: In member function 'clang::SourceLocation clang::ScratchBuffer::getToken(const char*, unsigned int)':
ScratchBuffer.cpp:38: error: 'memcpy' was not declared in this scope ... CFG.cpp: In member function 'void clang::CFG::viewCFG() const': CFG.cpp:1457: error: 'cerr' is not a member of 'std' ...GRSimpleVals.cpp:33: error: explicit template specialization cannot have a storage class GRSimpleVals.cpp:55: error: explicit template specialization cannot have a storage class
... llvm[1]: Compiling Rewriter.cpp for Debug-Asserts buildIn file included from /Volumes/HD/ltmp/ssen/llvm/tools/clang/ Rewrite/../include/clang/Rewrite/Rewriter.h:19,
from Rewriter.cpp:15:
/Volumes/HD/ltmp/ssen/llvm/tools/clang/Rewrite/../include/clang/
Rewrite/RewriteRope.h: In member function 'clang::RopePiece
clang::RewriteRope::MakeRopeString(const char*, const char*)':
/Volumes/HD/ltmp/ssen/llvm/tools/clang/Rewrite/../include/clang/
Rewrite/RewriteRope.h:243: error: 'memcpy' was not declared in this
scope
/Volumes/HD/ltmp/ssen/llvm/tools/clang/Rewrite/../include/clang/
Rewrite/RewriteRope.h:255: error: 'memcpy' was not declared in this
scope
/Volumes/HD/ltmp/ssen/llvm/tools/clang/Rewrite/../include/clang/
Rewrite/RewriteRope.h:264: error: 'memcpy' was not declared in this
scope
In file included from Rewriter.cpp:16: ... llvm[1]: Compiling SerializationTest.cpp for Debug-Asserts buildSerializationTest.cpp: In destructor 'virtual<unnamed>::SerializationTest::~SerializationTest()': SerializationTest.cpp:167: error: 'strlen' was not declared in this scope
Attached is a patch for all but the GRSimpleVals.cpp issue. Removing "static" fixes it, but I'm not really sure what the error is really trying to convey. For the other cases, the source files do indeed use those functions without explicitly including <string.h> or <iostream>, and it seems bad to rely on side effects of other headers, even if it used to work before.
clang.gcc-trunk.patch
Description: Binary data
Shantonu Sen [EMAIL PROTECTED] Sent from my Mac Pro
_______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
