>From: Martin Sebor <sebor@roguewave.com>
>We get over 800 of these remarks in each of our builds. I haven't
>analyzed them all but I did reduce one to a test case showing that
>at least in some instances the warning is wrong.

I've seen cases where it was right but we know what we are doing.
And a few broken cases.

We released a new compiler A.06.15 in Sept, with a patch A.06.16 in Dec.

>From: "Xiaohua zhang" <zhang@cup.hp.com>
>This bug has been fixed in ToT, you can try next week's weekly tarball to

Martin doesn't get them.

>From: Martin Sebor <sebor@roguewave.com>
>Btw., I just counted the number of remarks we get in stdcxx builds
>with aCC 6.15 and put together a breakdown. You might find the
>results interesting:http://issues.apache.org/jira/browse/STDCXX-695

Well, interesting in that you haven't figured out that you should just
suppress some of them.

You do know that there is a command "cadvise report logs ..." that
can produce a nice summary??

#2177-D: 8 variable was declared but never referenced
#2550-D: 28 variable was set but never used
#2826-D: 44 parameter was never referenced

Martin Sebor
added a comment - 16/Jan/08 03:21 Dennis' comments:
-------- Original Message --------
Subject: Re: aCC 6.15 bogus remark #3348
Date: Fri, 11 Jan 2008 18:03:44 -0800 (PST)
From: Dennis Handly <dhandly@cup.hp.com>
To: sebor@roguewave.com, zhang@cup.hp.com
CC: acxx@cup.hp.com
>From: Martin Sebor <sebor@roguewave.com>
>We get over 800 of these remarks in each of our builds. I haven't
>analyzed them all but I did reduce one to a test case showing that
>at least in some instances the warning is wrong.
I've seen cases where it was right but we know what we are doing.
And a few broken cases.
struct S { enum
{ X }
; };
template <class T>
int foo()
{
const int X = 1;
return X;
}
int main()
{ return foo<int>(); }
aCC: HP C/aC++ B3910B A.06.14 [Feb 22 2007]
line 4: remark #3348-D: declaration hides constant "S::X" (declared at line 1)
const int X = 1;
detected during instantiation of "int foo<T>() [with T=int] " at line 8
So this is an enum X that is in struct S, not even in scope here.
We released a new compiler A.06.15 in Sept, with a patch A.06.16 in Dec.
>From: "Xiaohua zhang" <zhang@cup.hp.com>
>This bug has been fixed in ToT, you can try next week's weekly tarball to
Martin doesn't get them.
>From: Martin Sebor <sebor@roguewave.com>
>Btw., I just counted the number of remarks we get in stdcxx builds
>with aCC 6.15 and put together a breakdown. You might find the
>results interesting:
http://issues.apache.org/jira/browse/STDCXX-695
Well, interesting in that you haven't figured out that you should just
suppress some of them.
You do know that there is a command "cadvise report logs ..." that
can produce a nice summary??
#2177-D: 8 variable was declared but never referenced
#2550-D: 28 variable was set but never used
#2826-D: 44 parameter was never referenced
Suppress with +W2177,2550,2826.
#2181-D: 9 argument is incompatible with corresponding format string conversion
This is usually your bug.
#3235-D: 1 nonstandard conversion between pointer to function and pointer to data
This isn't legal. You must use a type pun, or bigger hammer.
#3348-D: 799 declaration hides constant or variable
As you said, most are bogus.
#4219-D: 250 64 bit migration: type conversion may truncate value
#4298-D: 124 64 bit migration: addition result could be truncated before cast to bigger sized type
#4299-D: 20 64 bit migration: multiply result could be truncated before cast to bigger sized type
Probably not helpful. We have removed it from +wlint.
#4244-D: 4 extern storage class used with a function definition
A useless coding standard that no right thinking developer would want.
We are thinking of hiding it.
#4296-D: 695 arithmetic operation on boolean type
#4297-D: 1220 boolean value is used as array index
Another two that might not be useful.
#4282-D: 34 virtual function is called from constructor/destructor
A comment in that these aren't virtual.
#4300-D: 60 Overflow while computing constant in left shift operation
Probably a bug.
#4315-D: 60 while loop without body, did you insert an extra ';'?
An attempt to find typos.