diff --git a/kaitai/kaitaistream.cpp b/kaitai/kaitaistream.cpp index 352f99e..60ae80b 100644 --- a/kaitai/kaitaistream.cpp +++ b/kaitai/kaitaistream.cpp @@ -50,13 +50,12 @@ #include // int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t #include // std::reverse -#include // errno, ERANGE -#include // std::size_t -#include // std::strtoll +#include // errno, EINVAL, E2BIG, EILSEQ, ERANGE +#include // std::size_t, std::strtoll #include // std::memcpy #include // std::streamsize -#include // std::istream -#include // std::stringstream, std::ostringstream +#include // std::istream // IWYU pragma: keep +#include // std::stringstream, std::ostringstream // IWYU pragma: keep #include // std::runtime_error, std::invalid_argument, std::out_of_range #include // std::string, std::getline #include // std::vector @@ -589,6 +588,14 @@ std::string kaitai::kstream::process_rotate_left(std::string data, int amount) { #ifdef KS_ZLIB #include +// This instructs include-what-you-use not to suggest `#include ` just because it contains +// the definition of `Bytef`. It seems `` is not a header for public use or at least it's +// not considered necessary to include it on top of ``, because official usage examples that +// use `Bytef` only include ``, see +// https://github.com/madler/zlib/blob/0f51fb4933fc9ce18199cb2554dacea8033e7fd3/test/example.c#L71 +// +// IWYU pragma: no_include + std::string kaitai::kstream::process_zlib(std::string data) { int ret; diff --git a/kaitai/kaitaistream.h b/kaitai/kaitaistream.h index 60dab0b..58b4dee 100644 --- a/kaitai/kaitaistream.h +++ b/kaitai/kaitaistream.h @@ -11,10 +11,9 @@ #include // int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t -#include // std::streamsize -#include // std::istream +#include // std::streamsize, forward declaration of std::istream // IWYU pragma: keep #include // std::numeric_limits -#include // std::istringstream +#include // std::istringstream // IWYU pragma: keep #include // std::string #ifdef KAITAI_STREAM_H_CPP11_SUPPORT