[cfe-dev] Errors building clang with FSF gcc trunk

Shantonu Sen ssen at apple.com
Mon Mar 10 09:53:55 PDT 2008


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 build
Diagnostic.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 build
ScratchBuffer.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 build
In 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 build
SerializationTest.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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.gcc-trunk.patch
Type: application/octet-stream
Size: 1847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080310/89a338ca/attachment.obj>
-------------- next part --------------


Shantonu Sen
ssen at apple.com

Sent from my Mac Pro



More information about the cfe-dev mailing list