abseil-cpp icon indicating copy to clipboard operation
abseil-cpp copied to clipboard

[Bug]: Compile-time string format checking not working with MSVC

Open gix opened this issue 2 years ago • 0 comments

Describe the issue

The compile-time string format checking of absl::StrFormat doesn't work when compiling with MSVC.

I've looked through the docs of StrFormat and the C++ support matrix and couldn't find any mention of this. That's a pretty big footnote to leave out. And since the implementation isn't standards-compliant and instead defers to compiler extensions, it doesn't look like this is gonna change anytime soon.

Steps to reproduce the problem

absl::StrFormat("%s", 1); compiles instead of erroring.

What version of Abseil are you using?

lts_2023_01_25

What operating system and version are you using?

Windows

What compiler and version are you using?

cl 19.36.32534

What build system are you using?

Doesn't matter.

Additional context

No response

gix avatar Jun 14 '23 13:06 gix