Compiler doesn't warn for declared but unused variables

DLearner bmqazwsx123 at gmail.com
Fri Nov 27 16:34:07 UTC 2026


This code
```
void main() {

    size_t a;
    size_t b;

    a = 1;
}
```
compiles and executes silently, despite 'b' declared but not used.

It's not an error, but should it not generate a warning?


More information about the Digitalmars-d-learn mailing list