| ------------------------------------------------------------------------
| 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.
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
| ------------------------------------------------------------------------
| r55821 | drussel | 2010-04-29 04:19:59 +0200 (Thu, 29 Apr 2010) | 1 line
| Changed paths:
| M /trunk/Kinetic_data_structures/src/CGAL/numeric_solvers_support.cpp
|
| use the newish grand unified polynomial internally
| ------------------------------------------------------------------------
Reasons are:
- it uses C99 dynamic C arrays allocated on the stack instead of
std::vector,
- C99 dynamic C arrays are not in C++98 (they will probably be in C++0x),
- g++ implements that as an extension,
- VC++ does not,
- that is in libCGAL, and for that reason the whole CGAL testsuite is red
under Microsoft VC++.
Suggestion (already emailed to Daniel): use std::vector instead of dynamic
C arrays, and resubmit the patch.