Opened 14 years ago

Closed 14 years ago

#27789 closed defect (fixed)

cppcheck: fails to install in Leopard

Reported by: jpo@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: paj-macports@…
Port: cppcheck

Description

Hi,

The building process of cppcheck 1.46.1 (and 1.45) fails in Leopard (10.5).

Error messages:

...
g++ -O2 -DNDEBUG -Wall -Ilib -Icli -c -o test/testautovariables.o test/testautovariables.cpp
In file included from test/testautovariables.cpp:22:
test/testsuite.h:49:65: error: macro "assert" passed 3 arguments, but takes just 1
test/testsuite.h:49: error: variable or field ‘assert’ declared void
...

Change History (9)

comment:1 Changed 14 years ago by jpo@…

The problem described above occurs during "make all". In particular, the compilation aborts during the compilation of the sub-target "testrunner".

With the following patch it is possible to build and install cppcheck in Mac OS X Leopard (10.5):

--- Portfile.1461       2010-12-26 19:00:54.000000000 +0000
+++ Portfile    2010-12-26 19:42:46.000000000 +0000
@@ -31,7 +31,7 @@
 
 build.args          CXX=${configure.cxx} \
                     DB2MAN=${prefix}/share/xsl/docbook-xsl/manpages/docbook.xsl
-build.target        all man
+build.target        cppcheck man
 
 test.run               yes
 test.target            test

comment:2 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Please report this problem to the developers of cppcheck.

comment:3 Changed 14 years ago by paj-macports@…

Shall fix cppcheck so that the tests run.

comment:4 Changed 14 years ago by paj-macports@…

I don't have a Leopard installation on which to test (shall build a VM this week). The following patch should work:

diff --git a/test/testsuite.h b/test/testsuite.h
index 69fb777..f83d721 100644
--- a/test/testsuite.h
+++ b/test/testsuite.h
@@ -23,6 +23,9 @@
 #include <sstream>
 #include "errorlogger.h"
 #include "redirect.h"
+#ifdef assert
+#   undef assert
+#endif
 
 class options;

comment:5 in reply to:  2 Changed 14 years ago by jpo@…

Replying to ryandesign@…:

Please report this problem to the developers of cppcheck.

Yesterday I reported this problem upstream

There is already a comment in the ticket saying that it is safe to rename the assert method in the testsuite,h file.

/jpo

comment:6 Changed 14 years ago by paj-macports@…

Fixed upstream.

comment:7 in reply to:  6 Changed 14 years ago by jpo@…

Replying to paj-macports@…:

Fixed upstream.

You were faster than me ;)

For the record: Upstream fix: method assert method renamed to assert_. https://github.com/danmar/cppcheck/commit/58ddb3b0abd04b1dc1ac12c316b327d980189b1f

comment:8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

comment:9 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Resolved by updating the port to 1.47 (#28374).

Note: See TracTickets for help on using tickets.