473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Compiler with format-string warning option ?

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

Jul 23 '05 #1
2 1471
"Martin T." wrote:

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.
--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2
Karl Heinz Buchegger wrote:
"Martin T." wrote:

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

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: silviu | last post by:
Hi All, I have to write C++ code (server code) that will compile/run on both Windwos and Linux OS's. Could someone give me some pointers to info on this matter. Thanks in advance for your...
9
by: myhotline | last post by:
Hi all, After googling i came across Pelles C, is it a good C compiler over Windows( I am using Windows Xp )...Though Pelles C website says its a C99-compliant compiler, even though i would like...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
1
by: Sandy | last post by:
HI All, I have created a MFC exe using VC++ .NET 2003 on Windows XP Prof service pack 2 and it works properly on my machine, but when I run the same exe on a different machine (Windows XP Prof...
0
by: Sandy | last post by:
HI All, I have created a MFC exe using VC++ .NET 2003 on Windows XP Prof service pack 2 and it works properly on my machine, but when I run the same exe on a different machine (Windows XP Prof...
9
by: Bill Woessner | last post by:
Suppose I have a structure, foo, which is a POD. I would like to read and write it to disk as follows: std::ofstream outs; foo bar; outs.write(reinterpret_cast<char*>(&bar), sizeof(foo));...
12
by: Boris | last post by:
I'm trying to find out what the steps look like to upgrade a program (which is used on Windows and Unix) from Windows-1252 (the Windows "ANSI" code page) to UCS-2. Currently the program reads and...
2
by: call_me_anything | last post by:
We have an application which we build on linux and windows. In one particular set of operations (not necessary to describe here), the application crashes in Windows but not in Linux. I am not...
1
by: Vinod Sadanandan | last post by:
Cross Platform Migration An Unproblematic Approach (Windows-UNIX ) Oracle 10\11g The principal restriction on cross-platform transportable database is that the source and destination platform...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.