uninitialized vars on nerd.c

Andreas Ericsson ae at op5.se
Wed Nov 28 11:27:52 CET 2012


On 11/27/2012 05:27 PM, Ricardo Jose Maraschini wrote:
> * Ricardo Jose Maraschini (ricardo.maraschini at opservices.com.br) wrote:
>> fix warnings regarding uninitialized vars on nerd.c
>>
>> Index: base/nerd.c
>> ===================================================================
>> --- base/nerd.c	(revision 2472)
>> +++ base/nerd.c	(working copy)
>> @@ -298,9 +298,9 @@
>>   static int chan_opath_checks(int cb, void *data)
>>   {
>>   	const int red = 0xff0000, green = 0xff00, blue = 0xff, pale = 0x555555;
>> -	unsigned int color;
>> -	check_result *cr;
>> -	host *h;
>> +	unsigned int color = 0x0;
>> +	check_result *cr = NULL;
>> +	host *h = NULL;
>>   	const char *name = "_HOST_";
>>   	char *buf = NULL;
> 
> any answer on this one?
> 

This is the dumb way that just silences the warnings. The clever way is
about to be committed.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net




More information about the Developers mailing list