docs: document MSVC compile-time format checking limitation in str_format.h#2064
Conversation
derekmauro
left a comment
There was a problem hiding this comment.
The added top-level "Compiler Support Note" is a bit prominent and interrupts the introductory flow of the file. It describes a platform limitation rather than focusing on how to use the library correctly.
A cleaner, less distracting approach is to integrate this platform note directly into the sections that discuss compile-time format checking. This keeps the documentation focused on the feature itself and naturally qualifies it for MSVC users.
How about around line 51: "The FormatSpec<Args...> template is evaluated at compile-time, providing type safety (supported on GCC and Clang; on MSVC, these checks are deferred to runtime)."
And around line 180: "Note: Compile-time format string checking is supported on GCC and Clang. On MSVC, these checks are performed at runtime instead."
|
Thanks for the feedback! I've updated the PR to integrate the MSVC notes inline — one in the FormatSpec overview section and one just before the FormatSpec template declaration, as suggested. |
Fixes #1478
absl::StrFormat compile-time format string checking relies on
attribute((format(...))), a GCC/Clang-specific compiler extension
that MSVC does not support. This adds a note to the file-level
documentation so MSVC users are aware that format string errors will
only be caught at runtime, not at compile time.