Ann: MSVC sillywarning suppression

A

Alf P. Steinbach

A number of denizens of [comp.lang.c++] have contributed to this list, which
allows you to compile at highest warning level (including when using
<windows.h>) with no irrelevant sillywarnings, almost as if you were using g++:

http://alfps.wordpress.com/the-no_sillywarnings_please-h-file/

I'm sorry but I have not had the time to find those old discussion threads, so
in the blog I name no names.

But, you know who you are -- thanks!


Cheers,

- Alf

PS: The main idea is to add whatever sillywarnings one encounters; not warnings
that someone might be interested in, but the pure Microsoft sillywarnings. This
header file is now fairly stable but I have not used MSVC 9 much, and MSVC 10
not at all, and so there may be some new warnings that I don't know about. Just
add them (and perhaps post a comment here or at the blog page so that I also can
add them...).
 
R

red floyd

A number of denizens of [comp.lang.c++] have contributed to this list, which
allows you to compile at highest warning level (including when using
<windows.h>) with no irrelevant sillywarnings, almost as if you were using g++:

   http://alfps.wordpress.com/the-no_sillywarnings_please-h-file/

I'm sorry but I have not had the time to find those old discussion threads, so
in the blog I name no names.

But, you know who you are  --  thanks!

Cheers,

- Alf

PS: The main idea is to add whatever sillywarnings one encounters; not warnings
that someone might be interested in, but the pure Microsoft sillywarnings.. This
header file is now fairly stable but I have not used MSVC 9 much, and MSVC 10
not at all, and so there may be some new warnings that I don't know about.. Just
add them (and perhaps post a comment here or at the blog page so that I also can
add them...).

Alf, instead of the "This is MS-specific" #error, just include the
body for MS only.

i.e. instead of

#ifndef _MSC_VER
#error MS Only
#endif
// pragmas here

change it to:

#ifdef _MSC_VER
// pragmas here
#endif
 
A

Alf P. Steinbach

* red floyd, on 15.06.2010 17:38:
A number of denizens of [comp.lang.c++] have contributed to this list, which
allows you to compile at highest warning level (including when using
<windows.h>) with no irrelevant sillywarnings, almost as if you were using g++:

http://alfps.wordpress.com/the-no_sillywarnings_please-h-file/

I'm sorry but I have not had the time to find those old discussion threads, so
in the blog I name no names.

But, you know who you are -- thanks!

Cheers,

- Alf

PS: The main idea is to add whatever sillywarnings one encounters; not warnings
that someone might be interested in, but the pure Microsoft sillywarnings. This
header file is now fairly stable but I have not used MSVC 9 much, and MSVC 10
not at all, and so there may be some new warnings that I don't know about. Just
add them (and perhaps post a comment here or at the blog page so that I also can
add them...).

Alf, instead of the "This is MS-specific" #error, just include the
body for MS only.

i.e. instead of

#ifndef _MSC_VER
#error MS Only
#endif
// pragmas here

change it to:

#ifdef _MSC_VER
// pragmas here
#endif

Thanks for the suggestion. The reason that it's error is that I'd like to know
if automatic compiler dependent includes screws up. That particular macro stuff
(used elsewhere to include the file and other compiler dependent files) is
pretty hairy, perhaps non-standard, and I don't quite trust it! :)

I just post the file as I have it, with no hint of how it's included in my code,
and then others can copy it and modify it, or perhaps include from a file that
does the conditional.

In fact I did fall flat on my face wrt. the auto-redirection-include macros and
had to post about my eror, <url:
http://alfps.wordpress.com/2010/05/09/hubris-significant-spaces-g/>.

And then Genaro Prota made a few comments somewhere and I looked up his Breeze
library code where I found an apparently more robust scheme. I don't know, it
may be used in Boost (if so that's probably where I got the idea). One main
difference is that that code generates #include "..." while I do #include <...>.

It could be interesting to hear about other people's automatic compiler
dependent include redirection schemes?


Cheers, & thanks,

- Alf
 

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,262
Messages
2,571,052
Members
48,769
Latest member
Clifft

Latest Threads

Top