New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #27789 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

cppcheck: fails to install in Leopard

Reported by: jpo@… Owned by: ryandesign@…
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

comment:1 Changed 2 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 follow-up: ↓ 5 Changed 2 years ago by ryandesign@…

Please report this problem to the developers of cppcheck.

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

Shall fix cppcheck so that the tests run.

comment:4 Changed 2 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 2 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 follow-up: ↓ 7 Changed 2 years ago by paj-macports@…

Fixed upstream.

comment:7 in reply to: ↑ 6 Changed 2 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 2 years ago by ryandesign@…

  • Owner changed from macports-tickets@… to ryandesign@…
  • Status changed from new to assigned

comment:9 Changed 2 years ago by ryandesign@…

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Note: See TracTickets for help on using tickets.