ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

possibly dangling reference to a temporary in register_synop #279

Closed edigiacomo closed 1 year ago

edigiacomo commented 1 year ago

From https://simc.arpae.it/moncic-ci/dballe/202305180530/master/fedora38/build.log

2023-05-18 07:34:35 INFO system.fedora38 stderr: msg/wr_exporters/synop.cc: In lambda function:
2023-05-18 07:34:35 INFO system.fedora38 stderr: msg/wr_exporters/synop.cc:644:48: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
2023-05-18 07:34:35 INFO system.fedora38 stderr:   644 |                     const wr::TemplateFactory& fac = wr::TemplateRegistry::get(SYNOP_WMO_NAME);
2023-05-18 07:34:35 INFO system.fedora38 stderr:       |                                                ^~~
2023-05-18 07:34:35 INFO system.fedora38 stderr: msg/wr_exporters/synop.cc:644:79: note: the temporary was destroyed at the end of the full expression 'dballe::impl::msg::wr::TemplateRegistry::get(std::__cxx11::basic_string<char>(((const char*)"synop-wmo"), std::allocator<char>()))'
2023-05-18 07:34:35 INFO system.fedora38 stderr:   644 |                     const wr::TemplateFactory& fac = wr::TemplateRegistry::get(SYNOP_WMO_NAME);
2023-05-18 07:34:35 INFO system.fedora38 stderr:       |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
2023-05-18 07:34:36 INFO system.fedora38 stderr: msg/wr_exporters/synop.cc:649:48: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
2023-05-18 07:34:36 INFO system.fedora38 stderr:   649 |                     const wr::TemplateFactory& fac = wr::TemplateRegistry::get("synop-ecmwf");
2023-05-18 07:34:36 INFO system.fedora38 stderr:       |                                                ^~~
2023-05-18 07:34:36 INFO system.fedora38 stderr: msg/wr_exporters/synop.cc:649:79: note: the temporary was destroyed at the end of the full expression 'dballe::impl::msg::wr::TemplateRegistry::get(std::__cxx11::basic_string<char>(((const char*)"synop-ecmwf"), std::allocator<char>()))'
2023-05-18 07:34:36 INFO system.fedora38 stderr:   649 |                     const wr::TemplateFactory& fac = wr::TemplateRegistry::get("synop-ecmwf");
2023-05-18 07:34:36 INFO system.fedora38 stderr:       |