0

When using absl::StrFormat, I'm getting static code analysis warnings in VisualStudio 2017 (Red underlines). My code builds and runs but I can't figure out why I'm getting this warning. What could be causing this and is there anything I can do to fix or suppress the red underlines?

Here is a simple example,

absl::StrFormat("hello %s", "world");

no instance of function template "absl::lts_20210324::StrFormat" matches the argument list argument types are: (const char[9], const char[6])

J'e
  • 3,014
  • 4
  • 31
  • 55
  • The IDE check is done by a pass by the compiler with `/BE` switch. This compilation is different. It has `__EDG__` macro defined. I'm afraid all this stuff is undocumented. You can try to recreate the issue with latest Visual Studio (2022 preview), if it still exist, send feedback to Microsoft, in hopes that they can fix the issue. – Alex Guteniev Sep 09 '21 at 11:49
  • The StrFormat() function (along with others in Abseil) rely on variadic templates. https://en.cppreference.com/w/cpp/language/parameter_pack The template might not instantiate correctly on older C++ compilers. Abseil requires gcc 4.9+ likely for this reason and others. Dependencies are fun, eh? – seand Sep 17 '21 at 23:51

0 Answers0