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

bioparser.hpp: support building with Gcc 10 #7

Merged
merged 1 commit into from
May 7, 2020
Merged

bioparser.hpp: support building with Gcc 10 #7

merged 1 commit into from
May 7, 2020

Conversation

emollier
Copy link
Contributor

@emollier emollier commented May 2, 2020

Greetings,

When attempting to build various tools using bioparser.hpp with Gcc 10, the build crashes with errors such as the ones described on Debian bug #957747 or #957748. Here is a relevant extract for reference:

[...]
/usr/include/bioparser/bioparser.hpp: In lambda function:
/usr/include/bioparser/bioparser.hpp:839:24: error: ‘invalid_argument’ is not a member of ‘std’
  839 |             throw std::invalid_argument("[bioparser::SamParser] error: "
      |                        ^~~~~~~~~~~~~~~~
/usr/include/bioparser/bioparser.hpp:867:24: error: ‘invalid_argument’ is not a member of ‘std’
  867 |             throw std::invalid_argument("[bioparser::SamParser] error: "
      |                        ^~~~~~~~~~~~~~~~
/usr/include/bioparser/bioparser.hpp: In member function ‘bool bioparser::SamParser<T>::parse(std::vector<std::unique_ptr<T> >&, uint64_t, bool)’:
/usr/include/bioparser/bioparser.hpp:891:28: error: ‘invalid_argument’ is not a member of ‘std’
  891 |                 throw std::invalid_argument("[bioparser::SamParser] error: "
      |                            ^~~~~~~~~~~~~~~~

This is caused because a few functions, such as std::invalid_argument in that particular case, are not implicitely loaded by some headers anymore and now require including stdexcept. See Gnu recommendations for porting C++ code to Gcc 10 for more details.

This patch allows to move forward with building bioparser based tools with Gcc 10.

I hope this helps,
Kind Regards.

If I understand correctly https://gcc.gnu.org/gcc-10/porting_to.html, the header would need to include explicitely stdexcept, otherwise attempting to build programs using bioparser.hpp will fail to locate the definition of the multiple occurrences of std::invalid_argument.

This patch allows to move forward with building bioparser based tools with Gcc 10.
@rvaser rvaser merged commit 44a30f0 into rvaser:master May 7, 2020
@emollier emollier deleted the patch-1 branch May 8, 2020 10:48
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.

None yet

2 participants