Just changing the order of includes works around the issue.
The error was:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Surface_mesher_Demo/volume.cpp:10:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Surface_mesher_Demo/./volume.h:61:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/include/CGAL/Implicit_surface_3.h:23:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/include/CGAL/make_surface_mesh.h:23:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/include/CGAL/Surface_mesher_generator.h:24:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/include/CGAL/Surface_mesher/Surface_mesher.h:33:
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-78/include/CGAL/Double_map.h:40:
In file included from /home/lrineau/CGAL/boost/boost-release-branch/boost/bimap.hpp:13:
In file included from /home/lrineau/CGAL/boost/boost-release-branch/boost/bimap/bimap.hpp:61:
In file included from /home/lrineau/CGAL/boost/boost-release-branch/boost/bimap/detail/bimap_core.hpp:43:
In file included from /home/lrineau/CGAL/boost/boost-release-branch/boost/bimap/detail/manage_bimap_key.hpp:26:
In file included from /home/lrineau/CGAL/boost/boost-release-branch/boost/bimap/set_of.hpp:37:
/home/lrineau/CGAL/boost/boost-release-branch/boost/multi_index/ordered_index.hpp:1399:10: error: no member named 'Q_FOREACH' in namespace 'boost'
boost::foreach::tag)
~~~~~~~^
/usr/include/QtCore/qglobal.h:2418:21: note: expanded from macro 'foreach'
# define foreach Q_FOREACH
^
5 warnings and 1 error generated.
The warning was:
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:272:5: warning: variable 'g' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:277:19: note: uninitialized use occurs here
col = Color(r,g,b);
^
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:262:13: note: initialize the variable 'g' to silence this warning
int r, g, b;
^
= 0
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:272:5: warning: variable 'b' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:277:21: note: uninitialized use occurs here
col = Color(r,g,b);
^
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:262:16: note: initialize the variable 'b' to silence this warning
int r, g, b;
^
= 0
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:272:5: warning: variable 'r' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:277:17: note: uninitialized use occurs here
col = Color(r,g,b);
^
[...]/CGAL-4.1-Ic-78/include/CGAL/IO/io.h:262:10: note: initialize the variable 'r' to silence this warning
int r, g, b;
^
= 0
3 warnings generated.
That example no longer compiles. It was hidden by dont_submit for a long
time, but with a full branch-build (with WITH_demos and WITH_examples
enabled), it is in the way.
Pointed out by Joachim:
| Date: Sun, 10 Jun 2012 17:43:27 +0200
| From: Joachim Reichel <joachim.reichel@gmx.de>
| To: Laurent Rineau <laurent.rineau@geometryfactory.com>
| Subject: silence warnings caused by -Wunused-result
|
| Hi Laurent,
|
| your changes in 61145 and 61146 to silence the warnings in the Geomview
| package don't work with gcc 4.7.0 and -Wunused-result. I still see
|
| src/CGAL/Geomview_stream.cpp:148:35: warning: ignoring return value of
| 'ssize_t read(int, void*, size_t)', declared with attribute
| warn_unused_result [-Wunused-result]
|
| Maybe one really needs to use
|
| int result = read(...)
| (void) result;
|
| to silence the warnings.
|
| Joachim
I have not been able to reproduce that with my compiler "g++-trunk (GCC)
4.8.0 20120611 (experimental)".