Subject: Re: Warnings in nfsv3 code--buggy gcc?
To: Gordon W. Ross <gwr@mc.com>
From: J.T. Conklin <jconklin@netcom.com>
List: tech-kern
Date: 03/29/1996 12:06:41
> > -Wuninitialized is a good warning, but since it's not 100%, I don't
> > recommend combining it with -Werror. Some people get around this by
> > always initializing the variable to some dummy value. I think this
> > is terrible practice, as it defeats the ability of run-time tools
> > that track variable usage to detect uninitialized variable usage.
>
> Well, isn't the point to avoid uninitialized variables?
> If you initialize it, haven't you solved the problem?
I don't think so. When a program "acts" on an unintialized variable,
most often it's a case that the programmer didn't anticipate (ie. a
bug). If a the variable is initialized "just to shut the compiler
up", there is no telling that the program will behave as intended when
that dummy value is acted upon either.
--jtc