]> https://gitweb.dealii.org/ - dealii.git/commitdiff
cgal: disable diagnostics when including CGAL headers 14726/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 25 Jan 2023 04:36:31 +0000 (22:36 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 25 Jan 2023 16:51:45 +0000 (10:51 -0600)
This works around a hard to trace compilation warning that can be
triggered in some configurations in CGAL and Boost headers:

In file included from /usr/include/CGAL/Static_filtered_predicate.h:15,
                 from /usr/include/CGAL/Lazy_kernel.h:18,
                 from /usr/include/CGAL/Exact_predicates_exact_constructions_kernel.h:27,
                 from /usr/include/CGAL/Arr_segment_traits_2.h:30,
                 from /usr/include/CGAL/Gps_segment_traits_2.h:20,
                 from /usr/include/CGAL/Boolean_set_operations_2/complement.h:27,
                 from /usr/include/CGAL/Boolean_set_operations_2.h:21,
                 from /srv/temp/dealii/source/cgal/intersections.cc:33:
/usr/include/CGAL/Epic_converter.h: In member function ‘std::pair<CGAL::Segment_3<CGAL::Epick>, bool> CGAL::Epic_converter<IK>::operator()(const typename IK::Segment_3&) const [with IK = CGAL::Simple_cartesian<CGAL::Interval_nt<false> >]’:
/usr/include/CGAL/Epic_converter.h:305:29: note: ‘<anonymous>’ declared here
  305 |       return std::make_pair(Segment_3(),false);
      |                             ^~~~~~~~~~~

In constructor ‘constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = CGAL::Segment_3<CGAL::Epick>; _U2 = bool; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = CGAL::Segment_3<CGAL::Epick>; _T2 = bool]’,
    inlined from ‘constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = CGAL::Segment_3<CGAL::Epick>; _T2 = bool]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_pair.h:746:72,
    inlined from ‘std::pair<CGAL::Segment_3<CGAL::Epick>, bool> CGAL::Epic_converter<IK>::operator()(const typename IK::Segment_3&) const [with IK = CGAL::Simple_cartesian<CGAL::Interval_nt<false> >]’ at /usr/include/CGAL/Epic_converter.h:309:28:
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_pair.h:535:11: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  535 |         : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/CGAL/Epic_converter.h: In member function ‘std::pair<CGAL::Segment_3<CGAL::Epick>, bool> CGAL::Epic_converter<IK>::operator()(const typename IK::Segment_3&) const [with IK = CGAL::Simple_cartesian<CGAL::Interval_nt<false> >]’:
/usr/include/CGAL/Epic_converter.h:309:29: note: ‘<anonymous>’ declared here
  309 |       return std::make_pair(Segment_3(),false);
      |                             ^~~~~~~~~~~

include/deal.II/base/config.h.in
source/cgal/intersections.cc

index b391ed63884f5d57758280f726e5c9a8450afc0c..e506987e8bc6cd0678a0ea21e65f86e7f19248d5 100644 (file)
@@ -487,6 +487,7 @@ _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"")              \
 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")            \
 _Pragma("GCC diagnostic ignored \"-Winfinite-recursion\"")              \
 _Pragma("GCC diagnostic ignored \"-Wint-in-bool-context\"")             \
+_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")             \
 _Pragma("GCC diagnostic ignored \"-Wmisleading-indentation\"")          \
 _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"")      \
 _Pragma("GCC diagnostic ignored \"-Wnested-anon-types\"")               \
index 16097c9eb3d0b74766e996315a55e0360a41d845..d6470cbc1fa04fbb32579cc0787763341b87bbe5 100644 (file)
@@ -30,6 +30,7 @@
 
 #  include <deal.II/grid/tria.h>
 
+DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
 #  include <CGAL/Boolean_set_operations_2.h>
 #  include <CGAL/Cartesian.h>
 #  include <CGAL/Circular_kernel_intersections.h>
@@ -53,6 +54,7 @@
 #  include <CGAL/Triangulation_3.h>
 #  include <CGAL/Triangulation_face_base_with_id_2.h>
 #  include <CGAL/Triangulation_face_base_with_info_2.h>
+DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
 #  include <deal.II/cgal/utilities.h>
 
 #  include <fstream>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.