Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StringFormat for GCC 9 #38

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Conversation

stuart-auterion
Copy link
Contributor

After rebasing some of my other PRs on the latest main, I am no longer able to build. I get the error copied below.

It appears this was introduced to libmav in 00620a9 and stems from the fact that we're building on Ubuntu 20.04 and thus we use gcc 9. CI uses ubuntu-latest, which is 22.04, which is gcc 11. There appears to be some online discussion about the particular behavior causing this, and as far as I can tell it boils down to differences between cpp versions and compiler implementations for the different cpp standards. Anyway, we're required to use Ubuntu 20.04 as that is the latest approved for US government programs, so we need this to work for us.

Let me know if you'd prefer another way of working around this issue.

In file included from /home/stuart/Git/libmav/tests/../include/mav/MessageSet.h:41,
                 from /home/stuart/Git/libmav/tests/MessageSet.cpp:6:
/home/stuart/Git/libmav/tests/../include/mav/MessageDefinition.h: In member function ‘const mav::Field& mav::MessageDefinition::fieldForName(const string&) const’:
/home/stuart/Git/libmav/tests/../include/mav/MessageDefinition.h:337:54: error: use of deleted function ‘mav::StringFormat::StringFormat()’
  337 |                 throw std::out_of_range(StringFormat() << "Field \"" << field_key << "\" does not exist in message "
      |                                                      ^
In file included from /home/stuart/Git/libmav/tests/../include/mav/MessageDefinition.h:42,
                 from /home/stuart/Git/libmav/tests/../include/mav/MessageSet.h:41,
                 from /home/stuart/Git/libmav/tests/MessageSet.cpp:6:
/home/stuart/Git/libmav/tests/../include/mav/utils.h:120:9: note: ‘mav::StringFormat::StringFormat() noexcept’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  120 |         StringFormat() noexcept = default;
      |         ^~~~~~~~~~~~

@stuart-auterion
Copy link
Contributor Author

As an aside, I wouldn't be opposed to adding a CI case for Ubuntu 20.04. It would make our lives easier knowing we can update libmav more reliably. If that's something you'd be open to, let me know, and I can come up with a change and PR it.

Copy link

@jacobbandyk jacobbandyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

@ThomasDebrunner
Copy link
Contributor

Yep, a test for Ubuntu 20 would be useful!

@ThomasDebrunner ThomasDebrunner merged commit cf13f86 into main Jan 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants