Eike Lange wrote:
On Thu, Oct 31, 2002 at 06:01:15PM +0100, Frank Heckenbach wrote:
Use `-W' if you want a warning.
-Wall does not warn, but -W does.
That's as expected, and the same GCC does. See info: (gcc) Warning options:
: `-Wall' : [...] This enables all the : warnings about constructions that some users consider : questionable, and that are easy to avoid (or modify to prevent the : warning), even in conjunction with macros. : : [...] : : The following `-W...' options are not implied by `-Wall'. Some of : them warn about constructions that users generally do not consider : questionable, but which occasionally you might wish to check for; : others warn about constructions that are necessary or hard to avoid in : some cases, and there is no simple way to modify the code to suppress : the warning.
As has shown already in this thread, not all programms consider an empty `else' part a bug. Actually, there's one situation where I can imagine it to be useful, the dangling `else' problem:
if foo then if bar then baz else else qux
Though alternatively, one can use `begin'/`end' to avoid the empty `else' part:
if foo then begin if bar then baz end else qux
Frank