Subject: CGAL users discussion list
List archive
- From: Daisuke Sakurai <>
- To:
- Subject: [cgal-discuss] Bug in Inventor_ostream.h and VRML_2_ostream.h
- Date: Fri, 13 Dec 2013 23:50:18 +0900
I have found a possible bug in "Inventor_ostream.h" and "VRML_2_ostream.h".
I believe that the attached patches fix the problem.
Problem: some examples, which ship with CGAL 4.3, fail to compile.
Each of the examples include at least one of the two .h files.
In order to reproduce the bug for "Inventor_ostream.h", I simply need to compile the example,
CGAL-4.3/examples/Polyhedron_IO/off2iv.cpp
The compilations fail for the clang++ compiler, at least on my Mac OS X 10.9.
To avoid the errors, I applied the following patches:
-------
--- CGAL-4.3/include/CGAL/IO/Inventor_ostream.h.orig 2013-12-13 18:03:44.000000000 +0900
+++ CGAL-4.3/include/CGAL/IO/Inventor_ostream.h 2013-12-13 18:04:17.000000000 +0900
@@ -54,7 +54,7 @@
typedef const void* Const_void_ptr;
operator Const_void_ptr () const {
if ( m_os)
- return *m_os;
+ return m_os;
return 0;
}
#else
------
--- CGAL-4.3/include/CGAL/IO/VRML_2_ostream.h.orig 2013-12-13 18:30:39.000000000 +0900
+++ CGAL-4.3/include/CGAL/IO/VRML_2_ostream.h 2013-12-13 18:30:52.000000000 +0900
@@ -48,7 +48,7 @@
typedef const void* Const_void_ptr;
operator Const_void_ptr () const {
if ( m_os)
- return *m_os;
+ return m_os;
return 0;
}
#else
------
It seems that removing the asterisks makes the compilation continue.
However, I am not sure if this is the correct solution to the problem.
I attach the patches to this email.
Additional info:
which operating system, compiler, and hardware you are using:
Mac OS X 10.9
/usr/bin/clang++
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
Intel Core i7
information about how CGAL was installed on your system (i.e., which options were used, how the library was built, etc.):
I used macports.
$ sudo port install cgal +demos +qt4 +universal
a description of the problem or bug and a way to reproduce it (such as a small sample program or a sequence of commands):
Again,
$ sudo port install cgal +demos +qt4 +universal
Or more specifically, the following command reproduces the problem (after the above command "port install cgal +demos +qt4 +universal" leaves failing source codes).
$ sudo /usr/bin/clang++ -DCGAL_USE_GMP -DCGAL_USE_MPFR -pipe -Os -I/opt/local/include -arch x86_64 -arch i386 -DNDEBUG -arch x86_64 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_cgal/cgal/work/CGAL-4.3/examples/Polyhedron_IO/../../include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_cgal/cgal/work/CGAL-4.3/include -isystem /opt/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_cgal/cgal/work/CGAL-4.3/examples/Polyhedron_IO -o CMakeFiles/off2iv.dir/off2iv.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_cgal/cgal/work/CGAL-4.3/examples/Polyhedron_IO/off2iv.cpp
Thank you for your attention.
Sincerely,
Daisuke Sakurai
--- CGAL-4.3/include/CGAL/IO/Inventor_ostream.h.orig 2013-12-13
18:03:44.000000000 +0900
+++ CGAL-4.3/include/CGAL/IO/Inventor_ostream.h 2013-12-13 18:04:17.000000000
+0900
@@ -54,7 +54,7 @@
typedef const void* Const_void_ptr;
operator Const_void_ptr () const {
if ( m_os)
- return *m_os;
+ return m_os;
return 0;
}
#else
--- CGAL-4.3/include/CGAL/IO/VRML_2_ostream.h.orig 2013-12-13
18:30:39.000000000 +0900
+++ CGAL-4.3/include/CGAL/IO/VRML_2_ostream.h 2013-12-13 18:30:52.000000000
+0900
@@ -48,7 +48,7 @@
typedef const void* Const_void_ptr;
operator Const_void_ptr () const {
if ( m_os)
- return *m_os;
+ return m_os;
return 0;
}
#else
- [cgal-discuss] Bug in Inventor_ostream.h and VRML_2_ostream.h, Daisuke Sakurai, 12/13/2013
- Re: [cgal-discuss] Bug in Inventor_ostream.h and VRML_2_ostream.h, Philipp Moeller, 12/14/2013
- Re: [cgal-discuss] Bug in Inventor_ostream.h and VRML_2_ostream.h, Daisuke Sakurai, 12/15/2013
- Re: [cgal-discuss] Bug in Inventor_ostream.h and VRML_2_ostream.h, Philipp Moeller, 12/14/2013
Archive powered by MHonArc 2.6.18.