In the following snippet the wrong usage of format specifiers inside the MyFormat() call should produce a warning, according to SAL specifications, and if I uncomment the identical call of printf(), I really will receive all these warnings, but my code is compiled silently even with /W4. What am I doing wrong? I'm using MSVC 2017 15.9.7 Community edition.
#include <stdio.h>
#include <stdarg.h>
void MyFormat(_Printf_format_string_ const char *fmt, ...)
{
va_list va;
va_start(va, fmt);
vprintf(fmt, va);
va_end(va);
}
int main()
{
MyFormat("blabla %s\n", L"qq");
// printf("blabla %s\n", L"qq");
return 0;
}