oscarhiggott / PyMatching

PyMatching: A Python/C++ library for decoding quantum error correcting codes with minimum-weight perfect matching.
Apache License 2.0
187 stars 32 forks source link

DetectorNode `-Wreorder` build warnings #76

Closed Strilanc closed 1 year ago

Strilanc commented 1 year ago

Looks like DetectorNode is initializing fields in the wrong order. I don't think this is a bug, but it's like the first half of a bug.

src/pymatching/sparse_blossom/flooder/detector_node.h:58:13: warning: ‘pm::DetectorNode::observables_crossed_from_source’ will be initialized after [-Wreorder]
   58 |     obs_int observables_crossed_from_source;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pymatching/sparse_blossom/flooder/detector_node.h:55:19: warning:   ‘pm::DetectorNode* pm::DetectorNode::reached_from_source’ [-Wreorder]
   55 |     DetectorNode* reached_from_source;
      |                   ^~~~~~~~~~~~~~~~~~~
src/pymatching/sparse_blossom/flooder/detector_node.h:36:5: warning:   when initialized here [-Wreorder]
   36 |     DetectorNode()
      |     ^~~~~~~~~~~~
src/pymatching/sparse_blossom/flooder/detector_node.h:60:25: warning: ‘pm::DetectorNode::radius_of_arrival’ will be initialized after [-Wreorder]
   60 |     cumulative_time_int radius_of_arrival;
      |                         ^~~~~~~~~~~~~~~~~
src/pymatching/sparse_blossom/flooder/detector_node.h:47:22: warning:   ‘pm::GraphFillRegion* pm::DetectorNode::region_that_arrived’ [-Wreorder]
   47 |     GraphFillRegion* region_that_arrived;
      |                      ^~~~~~~~~~~~~~~~~~~
src/pymatching/sparse_blossom/flooder/detector_node.h:36:5: warning:   when initialized here [-Wreorder]
   36 |     DetectorNode()
      |     ^~~~~~~~~~~~