removed almost all occurenced (missing UseFiles). While
doing so, some CMakeLists.txt could also be simplified. In fact
many more CMakeLists.txt can be simplified, in one of two ways:
1) add external libs to CGAL_3RD_PARTY_LIBRARIES and
2) call cgal_create_single_source_program
-Wunused-local-typedefs is a new warning flag of gcc-4.7, and it will enabled
by -Wall since gcc-4.8 (not yet released).
The fix is a big set of removals of unused typedefs (or comments, or moves,
depending on the context).
| ------------------------------------------------------------------------
| r57003 | afabri | 2010-06-23 10:30:32 +0200 (Wed, 23 Jun 2010) | 1 line
|
| int -> size_t and static_casts
| ------------------------------------------------------------------------
The conversion from int to size_t is not always safe. Here the right type
was a signed type: std::ptrdiff_t, especially because the variable stores a
difference between two pointers.
The bug was discovered by a very recent version of clang:
clang version 3.2 (trunk 160721)
The error was:
cd /home/lrineau/CGAL/CGAL-4.1-Ic-113/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/src/CGAL && /usr/local/packages/llvm-trunk/bin/clang++ -DCGAL_EXPORTS -DCGAL_TEST_SUITE -DCGAL_USE_MPFR -DCGAL_USE_GMPXX -DCGAL_USE_GMP --std=c++11 -fno-strict-aliasing -Wall -fPIC -I/home/lrineau/CGAL/CGAL-4.1-Ic-113/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/include -I/home/lrineau/CGAL/CGAL-4.1-Ic-113/include -I/home/lrineau/CGAL/boost/boost-release-branch -o CMakeFiles/CGAL.dir/all_files.cpp.o -c /home/lrineau/CGAL/CGAL-4.1-Ic-113/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/src/CGAL/all_files.cpp
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-113/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/src/CGAL/all_files.cpp:2:
/home/lrineau/CGAL/CGAL-4.1-Ic-113/src/CGAL/JAMA_numeric_solver.cpp:83:14: error: case value evaluates to -1, which cannot be narrowed to type 'std::size_t' (aka 'unsigned long') [-Wc++11-narrowing]
case -1:
^
/home/lrineau/CGAL/CGAL-4.1-Ic-113/src/CGAL/JAMA_numeric_solver.cpp:109:14: error: case value evaluates to -1, which cannot be narrowed to type 'std::size_t' (aka 'unsigned long') [-Wc++11-narrowing]
case -1:
^
In file included from /home/lrineau/CGAL/CGAL-4.1-Ic-113/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/src/CGAL/all_files.cpp:13:
/home/lrineau/CGAL/CGAL-4.1-Ic-113/src/CGAL/Turkowski_numeric_solver.cpp:398:8: error: case value evaluates to -1, which cannot be narrowed to type 'std::size_t' (aka 'unsigned long') [-Wc++11-narrowing]
case -1:
^
/home/lrineau/CGAL/CGAL-4.1-Ic-113/src/CGAL/Turkowski_numeric_solver.cpp:431:8: error: case value evaluates to -1, which cannot be narrowed to type 'std::size_t' (aka 'unsigned long') [-Wc++11-narrowing]
case -1:
^
4 errors generated.
We declare
cmake_minimum_required(VERSION 2.6.2)
but we also use
cmake_policy(VERSION 2.8.4)
to declare that our CMake scripts are OK with all the defaults of CMake policies
as of CMake-2.8.4. That shuts down the warnings of CMake-2.8.4.
That way, we no longer need any declaration of specific policies.
Those two lines must be present and maintained in all our CMakeLists.txt
files (the one for the libraries, and also the one for examples and demos,
and maybe tests).
The documentation of CGAL says that the minimal version of CMake must be
CMake-2.6.2.
- change cmake_minimum_required to VERSION 2.6.2
- no longer any need for the policy CMP0003 (was for 2.4.x)
- no longer any need for CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS (was for 2.4)
In particular remove UNTESTED_XXXXXXXXXXX unused variable that possibly hide true warnings.
In those cases, the string printed while executed now starts with "NOTE: ".
*CGAL internal code no longer rely on depecrated features