why is this legal

Zhanyong Wan zhanyong.wan@yale.edu
Sat, 2 Feb 2002 12:29:57 -0500


I wrote:

| Therefore I believe -fwarn-unused-local-binding
| (if there is such an option) will detect the bug in Hal's code without
| flooding stderr in Martin's case.

While it is arguable whether the compiler should warn name shadowing by
default, I believe unused local bindings should always be warned since:

1. such are dead code;
2. they almost always indicate a mistake by the programmer;
3. removing them only improves the clarity of the code.

- Zhanyong