Silencing compiler warning D9025

G

Guest

We have some C++ code that has a makefile which contains both /W2 and /W3.
Due to the way the makefiles are written to be shared across multiple
projects, it's not trival to eliminate the duplicate compiler warning-level
directives. I'm trying to find a way to silence the following warning
displayed by Visual Studio 2005 for each file compiled:

cl : Command line warning D9025 : overriding '/W2' with '/W3'

One would think you could add '/wd9024' to the build rules to silence this.
But no - this option just adds a second warning to each file compiled:

cl : Command line warning D9014 : invalid value '9025' for '/wd'; assuming
'4999'

Any suggestions other then just removing one of /W3 or /W2 from the options
list?

Thanks for any tips you can share.
 
G

Guest

We have some C++ code that has a makefile which contains both /W2 and /W3.
Due to the way the makefiles are written to be shared across multiple
projects, it's not trival to eliminate the duplicate compiler warning-level
directives. I'm trying to find a way to silence the following warning
displayed by Visual Studio 2005 for each file compiled:

cl : Command line warning D9025 : overriding '/W2' with '/W3'

One would think you could add '/wd9024' to the build rules to silence this.
But no - this option just adds a second warning to each file compiled:

cl : Command line warning D9014 : invalid value '9025' for '/wd'; assuming
'4999'

/wd is used to silence compiler warning. i.e. Cxxxx. Since C9025 does not
exist, It defaults to C4999, which is defined as 'Unknown warning'
Any suggestions other then just removing one of /W3 or /W2 from the options
list?

Thanks for any tips you can share.

I have not used makefiles on windows, but I have done some projects on linux
that used makefiles. what we did there is specifying settings like that as
variables.
doing that makes it easy to supply default settings that can be changed.

As long as you use only that variable for specifying that setting, you will
not get duplicate /WX specifications.
VAR=/W3
VAR=/W2 //override previous

Another construct that might be useful is that in makefiles (at least on
linux) you can use a special construct that only assigns value to VAR if VAR
did not yet exist until that point. I think it was @= or $= (too long ago)

I don't know your build infrastructure, but by using these things you should
be able to achieve builds with only a single /W specification

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 

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

Top