Opened 11 years ago

Last modified 10 years ago

#5766 new Support Requests

Uninitialized variable warnings with GCC 4.4.5-6

Reported by: Bryce Adelstein Lelbach Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.47.0 Severity: Cosmetic
Keywords: Cc:

Description

Uninitialized variable warnings with Redhat GCC 4.4.5-6 (x86-64), Boost r73613:

In file included from /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/overlay.hpp:21,

from /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp:27, from /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/difference.hpp:14, from /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/geometry.hpp:47, from /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry.hpp:17, from /home/wash/hpx/examples/geometry/point_geometry/server/point.cpp:16:

/shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp: In member function ‘bool boost::geometry::detail::overlay::sort_on_segment_and_distance<TurnPoints, Indexed, Geometry1, Geometry2, Reverse1, Reverse2, Strategy>::operator()(const Indexed&, const Indexed&) const [with TurnPoints = std::deque<boost::geometry::detail::overlay::traversal_turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, std::allocator<boost::geometry::detail::overlay::traversal_turn_info<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> > > >, Indexed = boost::geometry::detail::overlay::indexed_turn_operation<boost::geometry::detail::overlay::traversal_turn_operation<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> > >, Geometry1 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, true, true, std::vector, std::vector, std::allocator, std::allocator>, Geometry2 = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, true, true, std::vector, std::vector, std::allocator, std::allocator>, bool Reverse1 = false, bool Reverse2 = false, Strategy = boost::geometry::strategy::side::side_by_triangle<void>]’: /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: warning: ‘pi.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[1ul]’ may be used uninitialized in this function [-Wuninitialized] /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: note: ‘pi.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[1ul]’ was declared here /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: warning: ‘pi.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[0ul]’ may be used uninitialized in this function [-Wuninitialized] /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: note: ‘pi.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[0ul]’ was declared here /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: warning: ‘pj.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[1ul]’ may be used uninitialized in this function [-Wuninitialized] /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: note: ‘pj.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[1ul]’ was declared here /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: warning: ‘pj.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[0ul]’ may be used uninitialized in this function [-Wuninitialized] /shared/boost/trunk/stage/gcc-4.4.5-release/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:114: note: ‘pj.boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>::<anonymous>.boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian>::m_values[0ul]’ was declared here

Change History (3)

comment:1 by Barend Gehrels, 11 years ago

m_values are not initialized on purpose. So this is not that easy to solve. Personally I never have this warning, compiling with gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5. Also in pedantic mode or with -Wextra I don't get them.

comment:2 by anonymous, 10 years ago

I also have this problem.

In file included from /dls/mx-scratch/upc86896/cctbx-svn/sources/cctbx_project/dxtbx/model/boost_python/detector.cc:20: /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp: In static member function 'static bool dxtbx::model::MultiFlatPanelDetector::panels_intersect(const dxtbx::model::FlatPanelDetector&, const dxtbx::model::FlatPanelDetector&)': /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: warning: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[1ul]' may be used uninitialized in this function /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: note: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[1ul]' was declared here /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: warning: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[0ul]' may be used uninitialized in this function /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: note: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[0ul]' was declared here /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: warning: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[1ul]' may be used uninitialized in this function /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: note: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[1ul]' was declared here /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: warning: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[0ul]' may be used uninitialized in this function /dls/mx-scratch/upc86896/cctbx-svn/sources/boost/boost/geometry/algorithms/disjoint.hpp:62: note: 'p.boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>::m_values[0ul]' was declared here

comment:3 by Barend Gehrels, 10 years ago

Type: BugsSupport Requests
Note: See TracTickets for help on using tickets.