Languages and Scripting

Re: pragma directive for warnings

 

pragma directive for warnings

Hi,

We are using HP ANSI C++ B3910B A.03.60
and are currently in the process
of porting our application to the 64-bit
world.

We use some third party include files which generate warnings that we know can be
safely ignored.

However, we do not want to disable the warnings
in our own code.

Is there a pragma directive that disables warnings on the aCC compiler?

e.g.

#pragma warning disable all
#include "thirdparty.h"
#pragma warning enable all

TIA,

Michael.
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: pragma directive for warnings

Generally the way to do that is to modify the CCFLAGS in your makefile(s) to either
-w (suppress all warnings) or (generally better) +W 600,321,697... to suppress specific warnings.
If it ain't broke, I can fix that.

Re: pragma directive for warnings

Sure, but I want to be able to disable
warnings at a finer granularity.

e.g. Other compilers offer pragmas that allow you to disable warnings at one point
in a compilation unit and then renable
them at another point.

If we could do this, then we dont have
to worry about third-party header files
that are churning out warnings (that we know are safe to ignore), but we dont disable
the warning for our own code, as we feel
they might be important.

Cheers,

Michael.
susan gregory_1
Valued Contributor

Re: pragma directive for warnings

I checked the aC++ pragma directives list at docs.hp.com:
http://docs.hp.com/en/1559/pragmas.htm

and there doesn't seem to be anything in there that will do what you want.

I checked the submitted defects/enhancements lists for the aC++ product and didn't see that anyone had submitted a request for a new pragma of this type.

If you strongly want this, I would suggest opening a call at the Response Center and requesting this pragma.
rick jones
Honored Contributor

Re: pragma directive for warnings

While the warnings may be safe to ignore, it might still be a good idea to report them to the third party in hopes that they can get them cleaned-up. Even if some pragma is found to exist.
there is no rest for the wicked yet the virtuous have no pillows