ZMQ 2.x compilation problems when building with disabled asserts.

Description

Get latest zeromq2-x from git.

run:

autogen.sh
./configure
make CXXFLAGS="-Wall -Werror -DNDEBUG"

This will cause next compilation problems:

Issue #1:

make[1]: Entering directory `zeromq2-x/build.vitaliy/tests'
CXX test_pair_inproc.o
cc1plus: warnings being treated as errors
In file included from ../../tests/test_pair_inproc.cpp:21:
../../tests/testutil.hpp: In function ‘void zmqtestutil::basic_tests(const char*, int, int)’:
../../tests/testutil.hpp:114: error: unused variable ‘rc’
make[1]: *** [test_pair_inproc.o] Error 1
make[1]: Leaving directory `zeromq2-x/build.vitaliy/tests'
make: *** [all-recursive] Error 1

Issue #2:

cc1plus: warnings being treated as errors
../../tests/test_hwm.cpp: In function ‘int main(int, char**)’:
../../tests/test_hwm.cpp:47: error: unused variable ‘sent’
../../tests/test_hwm.cpp:60: error: unused variable ‘received’
../../tests/test_hwm.cpp:64: error: unused variable ‘sent’
make[1]: *** [test_hwm.o] Error 1
make[1]: Leaving directory `zeromq2-x/build.vitaliy/tests'
make: *** [all-recursive] Error 1

After closer look to the sources I can see that asserts are messed a little bit.

Issue #3:
All source under src/ should user ZMQ asserts like:
zmq_assert, errno_assert, posix_assert, etc.
Some of them still using assert.

Issue #4:
include/zmq.hpp
uses ZMQ_ASSERT to prevent warnings when build with NDEBUG.
But this is a main ZMQ header and it should not provide any additional macros until there is a real need.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created August 3, 2012 at 11:54 AM
Updated August 5, 2012 at 4:12 AM
Resolved August 5, 2012 at 4:12 AM