mateidavid / fast5

A C++ header-only library for reading Oxford Nanopore Fast5 files
MIT License
53 stars 16 forks source link

hdf5_tools.hpp: fix build failure with gcc-12. #28

Closed emollier closed 2 years ago

emollier commented 2 years ago

When attempting to build fast5 with gcc-12, for instance in current debian experimental distribution, the build fails with the error described in Debian Bug#1012919. Relevant messages are:

[…]
/<<PKGBUILDDIR>>/src/../include/fast5/hdf5_tools.hpp:2298:70:   required from here
/usr/include/c++/12/type_traits:1135:52: error: static assertion failed: template argument must be a complete class or an unbounded array
[…]
/usr/include/c++/12/bits/stl_uninitialized.h:699:42: error: invalid use of incomplete type ‘std::iterator_traits<std::array<char, 1>*>::value_type’ {aka ‘struct std::array<char, 1>’}
[…]

According to gcc-12 porting guide, this looks to be a case of missing inclusion of <array>. The present commit fixes the build error without visible regressions with older gcc versions.

Signed-off-by: Étienne Mollier emollier@debian.org

jts commented 2 years ago

Thank you @emollier.