|
Message-ID: <20130616142435.GK29800@brightrain.aerifal.cx> Date: Sun, 16 Jun 2013 10:24:35 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: [PATCH] bugfix: initialize a state variable in lio_wait On Sun, Jun 16, 2013 at 11:31:58AM +0200, Jens Gustedt wrote: > In all, this re-enforces my opinion to *always* initialize variables, > unless I know that its address is immediately passed to an I disagree with this principle. If you initialize the variable to a dummy value, the compiler (or other static analysis tools) cannot catch erroneous use of the variable before a real value is stored in it. Also valgrind cannot catch them. Your "always initialize" principle only makes sense when (as in this case) there's an obvious "default value" the variable should have if it's not set elsewhere. But often that's not the case, especially for pointers. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.