Board index » cppbuilder » supressing warnings ...

supressing warnings ...


2006-02-22 06:51:28 PM
cppbuilder19
Hi,
we have functions that generate warnings at compile time.... "function toto hides virtual function toto ... " etc. etc.
For one reason or another we cant fix them (our version of the compiler has problems with "using" keyword). Anyways, we can't fix them (we tried) but these warnings are EVERYWHERE in the code.
I can supress all these warnings with
#pragma warn -hid
however that means we don't see any warnings of this nature. We would like to suppress the warning only for a specific class/function. Is that possible?
I'll email a pint to anybody that tells me *how* it is possible :)
G
 
 

Re:supressing warnings ...

"Gspot" wrote:
Quote

Hi,

we have functions that generate warnings at compile time.... "function
toto hides virtual function toto ... " etc. etc.

For one reason or another we cant fix them (our version of the compiler
has problems with "using" keyword). Anyways, we can't fix them (we tried)
but these warnings are EVERYWHERE in the code.

I can supress all these warnings with

#pragma warn -hid

however that means we don't see any warnings of this nature. We would like
to suppress the warning only for a specific class/function. Is that
possible?

I'll email a pint to anybody that tells me *how* it is possible :)
Use any version of lint to check your code... splint works great for me.
Use it after every compilation. Get your source "lint" clean and you have
reduced the bugs by 90% ... future bugs by 90% too at the same time (will
save a lot of money...)
In lint you can add a line comment to switch warnings on and off.
regards
John
 

Re:supressing warnings ...

Gspot wrote:
Quote
I can supress all these warnings with

#pragma warn -hid

however that means we don't see any warnings of this nature. We would like to suppress the warning only for a specific class/function. Is that possible?
Should be able to do this...wherever the compiler complains.
// hides virtual function toto
#pragma warn -hid
function toto();
#pragma warn +hid
 

{smallsort}

Re:supressing warnings ...

"Gspot" < XXXX@XXXXX.COM >writes:
Quote
we have functions that generate warnings at compile
time.... "function toto hides virtual function toto ... " etc. etc.
It seems that your code mixes overloading and overriding. In most
cases, this is a bad idea, since it not only confuses the compiler,
but also the human reader (I speak from experience ...).
 

Re:supressing warnings ...

Ooooooh my gosh I HATE when people make assumptions like that. I had somebody try explaining what a virtual function was to me before..... Dude I know ALL about it and trust me it wasn't ME that put this 10 year old legacy code into the state it was.
I too speak from experience.... :)
XXXX@XXXXX.COM (Thomas Maeder [TeamB]) wrote:
Quote
"Gspot" < XXXX@XXXXX.COM >writes:

>we have functions that generate warnings at compile
>time.... "function toto hides virtual function toto ... " etc. etc.

It seems that your code mixes overloading and overriding. In most
cases, this is a bad idea, since it not only confuses the compiler,
but also the human reader (I speak from experience ...).
 

Re:supressing warnings ...

thaks "dot" and "Bob"... perfect. I no longer have to live with the problem.. Appreciate that. ...
G
"grr" < XXXX@XXXXX.COM >wrote:
Quote

Ooooooh my gosh I HATE when people make assumptions like that. I had somebody try explaining what a virtual function was to me before..... Dude I know ALL about it and trust me it wasn't ME that put this 10 year old legacy code into the state it was.

I too speak from experience.... :)

XXXX@XXXXX.COM (Thomas Maeder [TeamB]) wrote:
>"Gspot" < XXXX@XXXXX.COM >writes:
>
>>we have functions that generate warnings at compile
>>time.... "function toto hides virtual function toto ... " etc. etc.
>
>It seems that your code mixes overloading and overriding. In most
>cases, this is a bad idea, since it not only confuses the compiler,
>but also the human reader (I speak from experience ...).

 

Re:supressing warnings ...

"grr" < XXXX@XXXXX.COM >writes:
Quote
Ooooooh my gosh I HATE when people make assumptions like that.
Please control your volume when talking to somebody who tried to help
you. Thanks!
 

Re:supressing warnings ...

look before you leap. cheers mate, graham
XXXX@XXXXX.COM (Thomas Maeder [TeamB]) wrote:
Quote
"grr" < XXXX@XXXXX.COM >writes:

>Ooooooh my gosh I HATE when people make assumptions like that.

Please control your volume when talking to somebody who tried to help
you. Thanks!

 

Re:supressing warnings ...

On 22 Feb 2006 03:51:28 -0700, "Gspot"
< XXXX@XXXXX.COM >wrote:
Quote

Hi,

we have functions that generate warnings at compile time.... "function toto hides virtual function toto ... " etc. etc.

For one reason or another we cant fix them (our version of the compiler has problems with "using" keyword). Anyways, we can't fix them (we tried) but these warnings are EVERYWHERE in the code.

I can supress all these warnings with

#pragma warn -hid

however that means we don't see any warnings of this nature. We would like to suppress the warning only for a specific class/function. Is that possible?

I'll email a pint to anybody that tells me *how* it is possible :)

G
build using the ide, and see if you can turn those warnings off. (you
have quite a selection in the ide for turning on and off warnings).
good luck
Jeff Kish
 

Re:supressing warnings ...

On 22 Feb 2006 09:27:49 -0700, "g" < XXXX@XXXXX.COM >wrote:
Quote

thaks "dot" and "Bob"... perfect. I no longer have to live with the problem.. Appreciate that. ...


G

"grr" < XXXX@XXXXX.COM >wrote:
>
>Ooooooh my gosh I HATE when people make assumptions like that. I had somebody try explaining what a virtual function was to me before..... Dude I know ALL about it and trust me it wasn't ME that put this 10 year old legacy code into the state it was.
>
>I too speak from experience.... :)
>
> XXXX@XXXXX.COM (Thomas Maeder [TeamB]) wrote:
>>"Gspot" < XXXX@XXXXX.COM >writes:
>>
>>>we have functions that generate warnings at compile
>>>time.... "function toto hides virtual function toto ... " etc. etc.
>>
>>It seems that your code mixes overloading and overriding. In most
>>cases, this is a bad idea, since it not only confuses the compiler,
>>but also the human reader (I speak from experience ...).
>
please tell us your final solution.. err the one for emailing a pint
of course.
Jeff Kish