Windows Compiler with format-string warning option ?

M

Martin T.

Hello.

Which Compilers for Windows can issue a warning for wrong printf-like
format strings?
i.e.:
int str = 311;
printf("H%so World!", str); // <-- Compiler warns about wrong type.

Are there any (free?) Windows C++ compilers that can warn about such
things?

best regards,
Martin
 
K

Karl Heinz Buchegger

Martin T. said:
Hello.

Which Compilers for Windows can issue a warning for wrong printf-like
format strings?
i.e.:
int str = 311;
printf("H%so World!", str); // <-- Compiler warns about wrong type.

Are there any (free?) Windows C++ compilers that can warn about such
things?

I think gcc does this sort of thing.
 
M

Martin T.

Karl said:
Martin T. said:
Hello.

Which Compilers for Windows can issue a warning for wrong printf-like
format strings?
[...]
I think gcc does this sort of thing.

Hmm ... is it possible to compile a MSVS6 Project with gcc (of course
not from the project-files, but is it possible in principle to compile
a MFC-C++ project with cygwin+gcc ?)

thanks!
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top