Skip to content

Commit 9135070

Browse files
authored
Fix leaky diagnostic ignored pragma (#4588)
Ignoring the `-Wconversion` diagnostic in `make_format_args` was leaking out of the header, resulting in that warning being ignored in downstream code that includes `fmt/base.h`. Instead, we should `push`/`pop` the diagnostics to ensure this is cleaned up.
1 parent ff357e9 commit 9135070

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/fmt/base.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ FMT_PRAGMA_GCC(optimize("Og"))
236236
# define FMT_GCC_OPTIMIZED
237237
#endif
238238
FMT_PRAGMA_CLANG(diagnostic push)
239+
FMT_PRAGMA_GCC(diagnostic push)
239240

240241
#ifdef FMT_ALWAYS_INLINE
241242
// Use the provided definition.
@@ -2997,6 +2998,7 @@ FMT_INLINE void println(format_string<T...> fmt, T&&... args) {
29972998
return fmt::println(stdout, fmt, static_cast<T&&>(args)...);
29982999
}
29993000

3001+
FMT_PRAGMA_GCC(diagnostic pop)
30003002
FMT_PRAGMA_CLANG(diagnostic pop)
30013003
FMT_PRAGMA_GCC(pop_options)
30023004
FMT_END_EXPORT

0 commit comments

Comments
 (0)