www.digitalmars.com         C & C++   DMDScript  

c++ - Selective Warning Disabling

reply "Rajiv Bhagwat" <dataflow vsnl.com> writes:
Walter,

Please accept the request to implement:

#pragma warning(disable:2)

to disable selective warnings.
I am not sure whether disabling errors like this is a good idea. (When would
that be useful?)

- Rajiv
Jan 03 2002
parent reply "Walter" <walter digitalmars.com> writes:
You can disable warning 2 from the command line using the switch:
    -w2

"Rajiv Bhagwat" <dataflow vsnl.com> wrote in message
news:a13iif$560$1 digitaldaemon.com...
 Walter,

 Please accept the request to implement:

 #pragma warning(disable:2)

 to disable selective warnings.
 I am not sure whether disabling errors like this is a good idea. (When
would
 that be useful?)

 - Rajiv
Jan 04 2002
parent reply "Rajiv Bhagwat" <dataflow vsnl.com> writes:
Yes, I know that, but when used in a makefile, it ignores the warnings for
all the files. What is required is that the warnings are to be disabled for
a specific file.

BTW, Ms-Windows code often has the same pragma, there it is disable:C2. You
could leave out that 'C' to take it as DMC warning number. (Any idea about
the 'C' in the first place?)

Also, I noticed that the IDDE does not show the warning number, only the
command line compiler shows it. Any reason?
-Rajiv


"Walter" <walter digitalmars.com> wrote in message
news:a15lj8$31bq$1 digitaldaemon.com...
 You can disable warning 2 from the command line using the switch:
     -w2

 "Rajiv Bhagwat" <dataflow vsnl.com> wrote in message
 news:a13iif$560$1 digitaldaemon.com...
 Walter,

 Please accept the request to implement:

 #pragma warning(disable:2)

 to disable selective warnings.
 I am not sure whether disabling errors like this is a good idea. (When
would
 that be useful?)

 - Rajiv
Jan 04 2002
parent "Walter" <walter digitalmars.com> writes:
"Rajiv Bhagwat" <dataflow vsnl.com> wrote in message
news:a169ml$cuj$1 digitaldaemon.com...
 Yes, I know that, but when used in a makefile, it ignores the warnings for
 all the files. What is required is that the warnings are to be disabled
for
 a specific file.
Ok, I understand. I'll add it to the list.
 BTW, Ms-Windows code often has the same pragma, there it is disable:C2.
You
 could leave out that 'C' to take it as DMC warning number. (Any idea about
 the 'C' in the first place?)
No, Microsoft's design decisions can only be guessed at! <g>
 Also, I noticed that the IDDE does not show the warning number, only the
 command line compiler shows it. Any reason?
 -Rajiv
Probably nobody thought of it.
Jan 05 2002