[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#6266) uninitialized var in overlays/dynlist.c:dl_cfgen()



masarati@aero.polimi.it wrote:
>> gcc complains
>>    dynlist.c:1537: warning: 'dlml' may be used uninitialized in this
>> function
>> Looks like its declaration at least should be moved outside the loop below
>> and it should be initialized to something.  This is the complete use of
>> dlml:
>>
>> 		for ( ... ) {
>> 			dynlist_map_t *dlml;
>> 			if ( dlm == NULL ) {
>> 				dlml = NULL;
>> 			}
>> 			if ( dlml != NULL )
>> 				dlml->dlm_next = dlmp;
>> 			dlml = dlmp;
>> 		}
>
> Not even sure about what that piece of code is supposed to do...

Indeed. It has no visible effect; an optimizer would just elide the entire block.


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/