Board index » cppbuilder » Code optimization & "aus" compiler warning

Code optimization & "aus" compiler warning


2004-10-12 02:36:56 AM
cppbuilder57
Using C++ 5.
Apparently optimizing for speed ("Release") confuses the compiler enough so
that it erroneously reports variables as having been assigned values that
are not used, when in fact they are used. This is particularly annoying
when it produces hundreds of warning messages. So, what I would like to do
is conditionally turn this warning OFF when compiling under "Release" mode.
Compiler flags "Od", "O1" and "O2" seem like good candidates to check, but I
do not know how to do that.
#if("Release" mode --- I don't know what to check)
#pragma option -w-aus
#endif
Thanks again,
Richard
 
 

Re:Code optimization & "aus" compiler warning

I would assume that you need to use one of -w-aus- or -w-8004-
. Ed
Quote
Richard wrote in message
news:416ad1ee$ XXXX@XXXXX.COM ...

Using C++ 5.
Apparently optimizing for speed ("Release") confuses
the compiler enough so that it erroneously reports variables
as having been assigned values that are not used, when in
fact they are used. This is particularly annoying when it
produces hundreds of warning messages. So, what I would
like to do is conditionally turn this warning OFF when
compiling under "Release" mode. Compiler flags "Od",
"O1" and "O2" seem like good candidates to check, but I
do not know how to do that.

#if("Release" mode --- I don't know what to check)

#pragma option -w-aus

#endif
 

Re:Code optimization & "aus" compiler warning

Yes, I know that eventually I will need to use "-w-aus" (see my original
posting), but how do I check for "Release" compile rather then "Debug"
compile? I only want to inhibit this warning for "Release".
Richard
"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
I would assume that you need to use one of -w-aus- or -w-8004-

. Ed

>Richard wrote in message
>news:416ad1ee$ XXXX@XXXXX.COM ...
>
>Using C++ 5.
>Apparently optimizing for speed ("Release") confuses
>the compiler enough so that it erroneously reports variables
>as having been assigned values that are not used, when in
>fact they are used. This is particularly annoying when it
>produces hundreds of warning messages. So, what I would
>like to do is conditionally turn this warning OFF when
>compiling under "Release" mode. Compiler flags "Od",
>"O1" and "O2" seem like good candidates to check, but I
>do not know how to do that.
>
>#if("Release" mode --- I don't know what to check)
>
>#pragma option -w-aus
>
>#endif


 

{smallsort}

Re:Code optimization & "aus" compiler warning

When doing a debug build the IDE defines the macro _DEBUG You might
test for that macro not being defined.
. Ed
Quote
Richard wrote in message
news: XXXX@XXXXX.COM ...

Yes, I know that eventually I will need to use "-w-aus" (see
my original posting), but how do I check for "Release"
compile rather then "Debug" compile? I only want to inhibit
this warning for "Release".