[MacPorts] #43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x"
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" --------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: cppcheck --------------------------+------------------------ building cppcheck 1.65 failed on the snowleopard buildbot: https://build.macports.org/builders/buildports-snowleopard- x86_64/builds/26449/steps/compile/logs/stdio {{{ ---> Building cppcheck DEBUG: Executing org.macports.build (cppcheck) DEBUG: Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6' DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.65" && /usr/bin/make -j8 -w all man CXX="/usr/bin/g++-4.2 -arch x86_64" HAVE_RULES=yes CFGDIR=/opt/local/share/cppcheck DB2MAN=/opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl' DEBUG: Executing command line: cd "/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.65" && /usr/bin/make -j8 -w all man CXX="/usr/bin/g++-4.2 -arch x86_64" HAVE_RULES=yes CFGDIR=/opt/local/share/cppcheck DB2MAN=/opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.65' /usr/bin/g++-4.2 -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/check64bit.o lib/check64bit.cpp /usr/bin/g++-4.2 -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/checkassert.o lib/checkassert.cpp /usr/bin/g++-4.2 -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/checkassignif.o lib/checkassignif.cpp /usr/bin/g++-4.2 -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/checkautovariables.o lib/checkautovariables.cpp /usr/bin/g++-4.2 -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/checkbool.o lib/checkbool.cpp /usr/bin/g++-4.2 -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/checkboost.o lib/checkboost.cpp /usr/bin/g++-4.2 -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/checkbufferoverrun.o lib/checkbufferoverrun.cpp /usr/bin/g++-4.2 -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 cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" make: *** [lib/check64bit.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [lib/checkclass.o] Error 1 make: *** [lib/checkbufferoverrun.o] Error 1 make: *** [lib/checkboost.o] Error 1 make: *** [lib/checkbool.o] Error 1 make: *** [lib/checkassert.o] Error 1 make: *** [lib/checkassignif.o] Error 1 make: *** [lib/checkautovariables.o] Error 1 }}} -- Ticket URL: <https://trac.macports.org/ticket/43757> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by xythobuz@…): It seems as if cppcheck requires a C++11 compiler since version 1.65 (http://sourceforge.net/p/cppcheck/news/2014/05/cppcheck-165/) These features are used throughout the code. I was able to compile it without the "-std=c++0x" option using Clang, but a lot of warnings were produced. To be honest, I'm not sure if there is a way around this problem, except upgrading the GCC used by the build bot from 4.2 to 4.4 (the minimum version mentioned by cppcheck), which is probably easier said then done. Should I somehow tell the buildbot not to build cppcheck for Snow Leopard? -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by egall@…):
To be honest, I'm not sure if there is a way around this problem, except upgrading the GCC used by the build bot from 4.2 to 4.4 (the minimum version mentioned by cppcheck), which is probably easier said then done.
The `gcc-4.2` used by the buildbot is the system compiler, and Apple stopped upgrading its system gcc at version 4.2, so upgrading the system gcc to 4.4 is out of the question. Instead, the port should use `compiler.blacklist` (and/or possibly also `compiler.whitelist` and/or `compiler.fallback`) to only allow MacPorts to use compilers that work. See the UsingTheRightCompiler wiki page for more info on how to do this. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by xythobuz@…):
Edit: turns out that that wiki page fails to mention those keywords specifically, but it still contains the same general idea that is necessary here.
Will the attached diff do the trick? -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by egall@…): Replying to [comment:4 xythobuz@…]:
Edit: turns out that that wiki page fails to mention those keywords specifically, but it still contains the same general idea that is necessary here.
Will the attached diff do the trick? I don't think I'm using these keywords in the right way, but I can't find proper documentation.
I would use `-append` with those keywords, and especially with `compiler.fallback`, because MacPorts already comes with a default fallback list of compilers, and without using `-append`, you end up overwriting it. Not exactly sure where the default fallback list is stored/documented though... -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by xythobuz@…): I have added the changes to the updated cppcheck 1.66 portfile in #44537, so this ticket can be closed. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by ryandesign@…): In #44537 your attachment adds these lines: {{{ compiler.blacklist-append gcc* compiler.fallback-append macports-clang }}} Blacklisting just "`gcc*`" will not blacklist any MacPorts gcc compilers, only those provided by Xcode, nor will it blacklist Xcode's or MacPorts' llvm-gcc, so think about what you really want there. There is no compiler called "`macports-clang`". There are multiple versions of MacPorts clang, e.g. "`macports-clang-3.4`", etc. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by xythobuz@…): Okay, that makes sense. Will this work? -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by cal@…): In r123101. If the code really uses C++11 the C++ runtime on SL will also be too old for this code and the use of `libc++` would be required. So far, projects using C++11 are only supported on Mavericks and beyond in MacPorts. It's worth a shot anyway, though. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: fixed | Keywords: Port: cppcheck | ---------------------------+------------------------ Changes (by cal@…): * status: new => closed * resolution: => fixed -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Changes (by cal@…): * status: closed => reopened * resolution: fixed => Comment: OK, the results from the SL buildbot are in, and unfortunately this doesn't solve the problem yet. That's because the system clang shipped with Xcode on SL was too old to compile C++ code and always used llvm-gcc to do that: {{{ DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.66" && /usr/bin/make -j8 -w all man CXX="/usr/bin/llvm-g++-4.2 -arch x86_64" HAVE_RULES=yes CFGDIR=/opt/local/share/cppcheck DB2MAN=/opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl' DEBUG: Executing command line: cd "/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.66" && /usr/bin/make -j8 -w all man CXX="/usr/bin/llvm-g++-4.2 -arch x86_64" HAVE_RULES=yes CFGDIR=/opt/local/share/cppcheck DB2MAN=/opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.66' /usr/bin/llvm-g++-4.2 -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/check.o lib/check.cpp /usr/bin/llvm-g++-4.2 -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/check64bit.o lib/check64bit.cpp /usr/bin/llvm-g++-4.2 -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/checkassert.o lib/checkassert.cpp /usr/bin/llvm-g++-4.2 -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/checkassignif.o lib/checkassignif.cpp /usr/bin/llvm-g++-4.2 -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/checkautovariables.o lib/checkautovariables.cpp /usr/bin/llvm-g++-4.2 -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/checkbool.o lib/checkbool.cpp /usr/bin/llvm-g++-4.2 -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/checkboost.o lib/checkboost.cpp /usr/bin/llvm-g++-4.2 -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/checkbufferoverrun.o lib/checkbufferoverrun.cpp cc1plus: error: unrecognized command line option "-std=c++0x"cc1plus: error: unrecognized command line option "-std=c++0x"cc1plus: error: unrecognized command line option "-std=c++0x"cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x"cc1plus: error: unrecognized command line option "-std=c++0x"cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-std=c++0x" make: *** [lib/checkbool.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [lib/checkboost.o] Error 1 make: *** [lib/checkassignif.o] Error 1 make: *** [lib/checkassert.o] Error 1 make: *** [lib/check64bit.o] Error 1 make: *** [lib/checkbufferoverrun.o] Error 1 make: *** [lib/check.o] Error 1 make: *** [lib/checkautovariables.o] Error 1 make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.66' Command failed: cd "/opt/local/var/macports/build/_opt_mports_dports_devel_cppcheck/cppcheck/work/cppcheck-1.66" && /usr/bin/make -j8 -w all man CXX="/usr/bin/llvm-g++-4.2 -arch x86_64" HAVE_RULES=yes CFGDIR=/opt/local/share/cppcheck DB2MAN=/opt/local/share/xsl/docbook-xsl/manpages/docbook.xsl }}} See https://lists.macosforge.org/pipermail/macports- dev/2014-July/027365.html for an explanation of the problem. The fix is to add {{{ PortGroup compiler_blacklist_versions 1.0 }}} and to add {{{ {clang < 137} }}} to the blacklist. OK to commit? -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cppcheck | ---------------------------+------------------------ Comment (by xythobuz@…): Yes, please do that. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
#43757: cppcheck @1.65: error: unrecognized command line option "-std=c++0x" ---------------------------+------------------------ Reporter: ryandesign@… | Owner: xythobuz@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: fixed | Keywords: Port: cppcheck | ---------------------------+------------------------ Changes (by cal@…): * status: reopened => closed * resolution: => fixed Comment: r123177. -- Ticket URL: <https://trac.macports.org/ticket/43757#comment:13> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts