Opened 6 years ago

Closed 6 years ago

#47962 closed defect (duplicate)

cppcheck @1.69 build failure

Reported by: dstrubbe (David Strubbe) Owned by: xythobuz@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: larryv (Lawrence Velázquez)
Port: cppcheck

Description

I had the previous version installed, but when upgrading it fails with errors like those below. XCode 5.1.1, OS 10.8.5.

:info:build /usr/bin/clang++ -arch x86_64 -Ilib -Iexternals/tinyxml  -DCFGDIR=\"/opt/local/share/cppcheck\" -O2 -include lib/cxx11emu.h  -DNDEBUG -Wall -DHAVE_RULES -DTIXML_USE_STL -I/opt/local/include  -std=c++0x -c -o lib/checkclass.o lib/checkclass.cpp
:info:build In file included from lib/check.cpp:23:
:info:build In file included from lib/check.h:27:
:info:build In file included from lib/settings.h:29:
:info:build lib/library.h:110:56: error: no member named 'cend' in 'std::map<std::basic_string<char>, std::pair<bool, bool>, std::less<std::basic_string<char>>, std::allocator<std::pair<const std::basic_string<char>, std::pair<bool, bool>>>>'
:info:build         return _formatstr.find(funcname) != _formatstr.cend();
:info:build                                             ~~~~~~~~~~ ^

Attachments (1)

main.log (14.9 KB) - added by dstrubbe (David Strubbe) 6 years ago.

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by dstrubbe (David Strubbe)

Attachment: main.log added

comment:1 Changed 6 years ago by xythobuz@…

Hmm, I'm not sure why this is happening. The clang and libc++ included with your XCode version should certainly support the C++11 feature cend. Are you sure you don't have any other compilers or standard libraries installed? Could you post the output of /usr/bin/clang++ --version

comment:2 Changed 6 years ago by dstrubbe (David Strubbe)

Yes I do have various other compilers (gcc, g95, dragonegg, llvm) installed, via macports, though I don't see how they would impact this issue.

$ /usr/bin/clang++ --version
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.6.0
Thread model: posix

comment:3 in reply to:  2 Changed 6 years ago by xythobuz@…

Aha, So you're using LLVM 3.1, which has no full C++11 support. That should be the reason for the error. As far as I know, XCode 5.1.1 should include LLVM 3.3 which has full C++11 support and should be able to compile cppcheck. I'm not sure why your system is not using the XCode compiler, to be honest.

comment:4 Changed 6 years ago by dstrubbe (David Strubbe)

I changed the blacklist temporarily to {clang < 600} to make it use macports-clang-3.4, and I got the same error. So, it doesn't seem to be an issue about the compiler per se or even the LLVM version, since this compiler uses LLVM-3.4 according to the dependencies.

$ /opt/local/bin/clang++-mp-3.4 --version
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Target: x86_64-apple-darwin12.6.0
Thread model: posix

comment:5 Changed 6 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:6 Changed 6 years ago by xythobuz@…

I think it's not the compiler that is at fault, but the standard library it is using. That's because the missing symbol is part of the stdlib. Do you think there could be something wrong in this regard?

Unfortunately, I was still not able to replicate your error.

comment:7 Changed 6 years ago by dstrubbe (David Strubbe)

Yes, it may well be about the stdlib, I am not sure how that would work. I did find many hits on Google for this particular error message, although I didn't see any solution I understood or that seemed applicable here.

comment:8 Changed 6 years ago by dstrubbe (David Strubbe)

Resolution: duplicate
Status: newclosed

The presence of this ticket seems not to have been noticed when opening and discussing the later ticket #48293.

Note: See TracTickets for help on using tickets.