www.digitalmars.com         C & C++   DMDScript  

c++.command-line - Unused variable warning

reply Ron Dunn <Ron_member pathlink.com> writes:
Is there a switch to report "unused variables" as warnings?

I currently use VC6 for software development, and appreciate the warning that
I've declared a variable which is not referenced.

I'm a new user of DM, and I can't find a similar warning setting. Advice from
more advanced users is appreciated.
Sep 01 2003
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Ron Dunn" <Ron_member pathlink.com> wrote in message
news:bj175d$osu$1 digitaldaemon.com...
 Is there a switch to report "unused variables" as warnings?

 I currently use VC6 for software development, and appreciate the warning

 I've declared a variable which is not referenced.

 I'm a new user of DM, and I can't find a similar warning setting. Advice

 more advanced users is appreciated.

There isn't one in DMC, for the rather personal reason that I like to #ifdef out code for various reasons and not need to comment out the declarations for it, too.
Sep 01 2003
next sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
You shocking old dog!

Put it in.

"Walter" <walter digitalmars.com> wrote in message
news:bj1cje$10sh$1 digitaldaemon.com...
 "Ron Dunn" <Ron_member pathlink.com> wrote in message
 news:bj175d$osu$1 digitaldaemon.com...
 Is there a switch to report "unused variables" as warnings?

 I currently use VC6 for software development, and appreciate the warning

 I've declared a variable which is not referenced.

 I'm a new user of DM, and I can't find a similar warning setting. Advice

 more advanced users is appreciated.

There isn't one in DMC, for the rather personal reason that I like to

 out code for various reasons and not need to comment out the declarations
 for it, too.

Sep 02 2003
parent "Greg Peet" <admin REMOVEMEgregpeet.com> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bj1tqo$1qqf$1 digitaldaemon.com...
| You shocking old dog!
|
| Put it in.

Yes, please do !
Sep 02 2003
prev sibling parent Ron Dunn <Ron_member pathlink.com> writes:
Hahahahahah ... what a pleasant change to hear direct from a product developer
:)

If you should be in a benevolent mood one day, and think about including this
feature, make it default to OFF and you won't have to change your working
habits.

Thanks for the response.

Ron.

In article <bj1cje$10sh$1 digitaldaemon.com>, Walter says...
"Ron Dunn" <Ron_member pathlink.com> wrote in message
news:bj175d$osu$1 digitaldaemon.com...
 Is there a switch to report "unused variables" as warnings?

 I currently use VC6 for software development, and appreciate the warning

 I've declared a variable which is not referenced.

 I'm a new user of DM, and I can't find a similar warning setting. Advice

 more advanced users is appreciated.

There isn't one in DMC, for the rather personal reason that I like to #ifdef out code for various reasons and not need to comment out the declarations for it, too.

Sep 03 2003
prev sibling parent reply Cesar Rabak <csrabak uol.com.br> writes:
Ron Dunn escreveu:
 Is there a switch to report "unused variables" as warnings?

 I currently use VC6 for software development, and appreciate the
 warning that I've declared a variable which is not referenced.

 I'm a new user of DM, and I can't find a similar warning setting.
 Advice from more advanced users is appreciated.

have this warning and perhaps for other possible bugs in your code, I recommend you look at Splint http://www.splint.org/ HTH -- Cesar Rabak GNU/Linux User 52247. Get counted: http://counter.li.org/
Sep 02 2003
parent Ron Dunn <Ron_member pathlink.com> writes:
Thank you, Cesar.

I tried splink, and almost had a heart attack at the number of errors and
warnings reported on what I thought was good quality code.

Once I found the -weak command line parameter the smile started to return to my
face. I'd like to move towards stronger checking, but I don't want to rush into
littering the code with the on/off comment flags apparently needed by splink at
its most defensive.

Ron.

In article <3F550D80.6010502 uol.com.br>, Cesar Rabak says...
Ron Dunn escreveu:
 Is there a switch to report "unused variables" as warnings?

 I currently use VC6 for software development, and appreciate the
 warning that I've declared a variable which is not referenced.

 I'm a new user of DM, and I can't find a similar warning setting.
 Advice from more advanced users is appreciated.

have this warning and perhaps for other possible bugs in your code, I recommend you look at Splint http://www.splint.org/ HTH -- Cesar Rabak GNU/Linux User 52247. Get counted: http://counter.li.org/

Sep 03 2003