Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
September 02, 2003 Unused variable warning | ||||
---|---|---|---|---|
| ||||
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. |
September 02, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ron Dunn | "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 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. 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. |
September 02, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 > 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. > > 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. > > |
September 02, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bj1tqo$1qqf$1@digitaldaemon.com... | You shocking old dog! | | Put it in. Yes, please do ! |
September 02, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ron Dunn | 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. > As Walter already pointed out, there is none, so if you would like to 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/ |
September 03, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 >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. > >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. > > |
September 03, 2003 Re: Unused variable warning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Cesar Rabak | 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.
> >
>As Walter already pointed out, there is none, so if you would like to 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/
>
|
Copyright © 1999-2021 by the D Language Foundation