Project

General

Profile

Support #16106

Support #16096: Fix problems found when attempting to build with gcc 6.3.0

problem compiling Dumpers with gcc 6.3.0

Added by Lynn Garren over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Other
Target version:
-
Start date:
04/05/2017
Due date:
% Done:

100%

Estimated time:
Spent time:
Experiment:
LArSoft
Co-Assignees:
Duration:

Description

The compilation of several Dumper modules fails when compiled with gcc 6.3.0. They all exhibit the same symptom. Here is the error message for lardata/ArtDataHelper/Dumpers/DumpVertices_module.cc:

[ 45%] Building CXX object lardata/lardata/ArtDataHelper/Dumpers/CMakeFiles/lardata_ArtDataHelper_Du
mpers_DumpVertices_module.dir/DumpVertices_module.cc.o
/home/garren/scratch/larsoft/dev/srcs/lardata/lardata/ArtDataHelper/Dumpers/DumpVertices_module.cc:9
5:39: error: constructor required before non-static data member for ‘{anonymous}::VertexDumper::Prin
tOptions_t::hexFloats’ has been parsed
       PrintOptions_t print_options = {}
                                       ^
/home/garren/scratch/larsoft/dev/srcs/lardata/lardata/ArtDataHelper/Dumpers/DumpVertices_module.cc:9
5:39: error: could not convert ‘<brace-enclosed initializer list>()’ from ‘<brace-enclosed initializ
er list>’ to ‘{anonymous}::VertexDumper::PrintOptions_t’

History

#1 Updated by Gianluca Petrillo over 3 years ago

  • Category set to Other
  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Nested classes are not considered defined until the enclosing class is completely parsed.
Using the constructor of a nested class to assign a default value to a method parameter requires the class of that parameter to be defined, which is not the case yet at the point the method is declared.

I had to give up using default values for the arguments, and implement two separate constructors (not that separate, since one calls the other...).
Solved with lardata:3154ba9366006cb2759eb6435634f7b0a9197d43 .

#2 Updated by Lynn Garren over 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF