Skip to content

New warning on gcc 13 #544

@mikekryjak

Description

@mikekryjak

Compiling on gcc 13 adds a new warning. It's harmless, but since warnings will stop compilation by default, you will need to suppress warnings to compile until this is resolved if you're on gcc 13 or above.

/home/mike/work/hermes-3/src/izn_rec_reaction.cxx: In member function ‘virtual void hermes::IznRecReaction::transform_additional(GuardedOptions&, const hermes::RateData&)’:
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:108:18: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  108 |   const Field3D& n_rh = hr["density"].GetRef<Field3D>();
      |                  ^~~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:108:54: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"density")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  108 |   const Field3D& n_rh = hr["density"].GetRef<Field3D>();
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:109:18: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  109 |   const Field3D& v_rh = hr["velocity"].GetRef<Field3D>();
      |                  ^~~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:109:55: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"velocity")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  109 |   const Field3D& v_rh = hr["velocity"].GetRef<Field3D>();
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:113:18: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  113 |   const Field3D& v_hp = hp["velocity"].GetRef<Field3D>();
      |                  ^~~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:113:55: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"velocity")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  113 |   const Field3D& v_hp = hp["velocity"].GetRef<Field3D>();
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:149:18: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  149 |   const Field3D& T_e = electron["temperature"].GetRef<Field3D>();
      |                  ^~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:149:63: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"temperature")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  149 |   const Field3D& T_e = electron["temperature"].GetRef<Field3D>();
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:161:22: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  161 |       const Field3D& v_e = electron["velocity"].GetRef<Field3D>();
      |                      ^~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:161:64: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"velocity")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  161 |       const Field3D& v_e = electron["velocity"].GetRef<Field3D>();
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:168:18: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  168 |   const Field3D& n_e = electron["density"].GetRef<Field3D>();
      |                  ^~~
/home/mike/work/hermes-3/src/izn_rec_reaction.cxx:168:59: note: the temporary was destroyed at the end of the full expression ‘GuardedOptions::operator[](const char*) const(((const char*)"density")).GuardedOptions::GetRef<Field3D>(Regions::All)’
  168 |   const Field3D& n_e = electron["density"].GetRef<Field3D>();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions