Board index » cppbuilder » Turn off warnings

Turn off warnings

Hello!

How can I tell the compiler/linker to not report warnings in a specific
header or source file?
------------------------------------------------------------------------
Nicolas Koulouris                                nicolas...@videotron.ca

                   "The best way to predict the future is to invent it."

                                                              - Alan Kay

 

Re:Turn off warnings


Quote

> How can I tell the compiler/linker to not report warnings in a specific
> header or source file?

put a pramga at the top of the .cpp file

#pragma warn -XXXX

where XXXX is the warning.  This is for compiler warnings.  I don't know
about linker warnings.  This will only turn it off for that .cpp file.  If
you wanted to turn it off just for a specific section of code then you can
do this

#pragma warn -XXXX
.... Code ....
#pragma warn +XXXX

Russell

Other Threads