Closed pavard closed 6 months ago
Thanks for reporting but FMT_PEDANTIC
and FMT_WERROR
are internal {fmt}'s options used in CI and not supposed to be used externally.
Maybe it would be possible to make an edit like this, please (fmt/format-inl.h:1493):
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
// Force buffer initialization by placing and removing a char in a buffer.
putc_unlocked(0, this->file_);
#pragma GCC diagnostic pop
Suppressing this false positive with a pragma is a bit messy but maybe it could be done in a cleaner way, e.g. using assume
: https://github.com/fmtlib/fmt/blob/4e8640ed90ac8751d4a8ca500b893cc8c4bb9668/include/fmt/format.h#L484
It also seems weird that gcc complains about the file stream pointer being null because it is being dereference here: https://github.com/fmtlib/fmt/blob/4e8640ed90ac8751d4a8ca500b893cc8c4bb9668/include/fmt/format-inl.h#L1493
Subj. ArchLinux gcc: 13.2.1 glibc: 2.39