You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compile-time format string checks by default #2022
One small concern here is that compile-time checks work only for format strings that don't have named identifiers since, currently, named arguments are not able to provide their names at compile-time.
I'm not so concern about the same behavior of compile-time checks invoked by FMT_STRING, because it's kinda extension, which just fails to work with named identifiers by failing a compilation process.
But it feels strange, at least for me, to disable compile-time checks (that will be enabled by default) only for format strings with named identifiers.
Activity
alexezeder commentedon Apr 15, 2021
One small concern here is that compile-time checks work only for format strings that don't have named identifiers since, currently, named arguments are not able to provide their names at compile-time.
I'm not so concern about the same behavior of compile-time checks invoked by
FMT_STRING, because it's kinda extension, which just fails to work with named identifiers by failing a compilation process.But it feels strange, at least for me, to disable compile-time checks (that will be enabled by default) only for format strings with named identifiers.
vitaut commentedon Apr 16, 2021
Compile-time checks can potentially be made to work with a UDL form of named arguments.
alexezeder commentedon Apr 16, 2021
But that's only one way of creating named arguments. The problem with
fmt::arg(name, value)would still be relevant.vitaut commentedon Apr 16, 2021
Right. Maybe some day we'll have parametric expressions or constexpr arguments that will make it possible.
vitaut commentedon Jun 7, 2021
Compile-time checks are enabled now in compilers that have working
consteval(gcc 10+, clang 11+).