Re: DMD compiler - warning of unused variables

2021-08-16 Thread russhy via Digitalmars-d-learn
On Monday, 16 August 2021 at 14:14:27 UTC, DLearner wrote: Hi Please see code below: ``` void main() { import std.stdio; size_t i; size_t j; i = 5; writeln("i = ",i); } ``` Is there a compiler option that would warn that variable 'j' is defined but not used? Best regards

Re: DMD compiler - warning of unused variables

2021-08-16 Thread user1234 via Digitalmars-d-learn
On Monday, 16 August 2021 at 14:14:27 UTC, DLearner wrote: Is there a compiler option that would warn that variable 'j' is defined but not used? Best regards No in DMD but you can use [D-Scanner](https://code.dlang.org/packages/dscanner) for that. The check works reasonably as long as the

Re: DMD compiler - warning of unused variables

2021-08-16 Thread jfondren via Digitalmars-d-learn
On Monday, 16 August 2021 at 14:14:27 UTC, DLearner wrote: Hi Please see code below: ``` void main() { import std.stdio; size_t i; size_t j; i = 5; writeln("i = ",i); } ``` Is there a compiler option that would warn that variable 'j' is defined but not used? Best regards

Re: DMD compiler - warning of unused variables

2021-08-16 Thread rikki cattermole via Digitalmars-d-learn
No. https://github.com/dlang-community/D-Scanner#implemented-checks

DMD compiler - warning of unused variables

2021-08-16 Thread DLearner via Digitalmars-d-learn
Hi Please see code below: ``` void main() { import std.stdio; size_t i; size_t j; i = 5; writeln("i = ",i); } ``` Is there a compiler option that would warn that variable 'j' is defined but not used? Best regards