svn commit: r335379 - head/sys/contrib/libnv

Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net
Tue Jun 19 20:23:28 UTC 2018


> Author: sbruno
> Date: Tue Jun 19 18:09:15 2018
> New Revision: 335379
> URL: https://svnweb.freebsd.org/changeset/base/335379
> 
> Log:
>   Set prev to NULL so its garaunteed to have a value of some kind and
>   gcc doesn't explode.  Feel free to fix this correctly or whatever for
>   gcc builds.
>   
>   This *should* quiesce tinderbox after r335347 for the gcc builds.
> 
> Modified:
>   head/sys/contrib/libnv/nvpair.c
> 
> Modified: head/sys/contrib/libnv/nvpair.c
> ==============================================================================
> --- head/sys/contrib/libnv/nvpair.c	Tue Jun 19 17:41:46 2018	(r335378)
> +++ head/sys/contrib/libnv/nvpair.c	Tue Jun 19 18:09:15 2018	(r335379)
> @@ -1979,7 +1979,7 @@ int
>  nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value)
>  {
>  	nvpair_t *tmpnvp;
> -	nvlist_t *nvl, *prev;
> +	nvlist_t *nvl, *prev = NULL;

Please please please mark these so that people *can* at some time
know that this was 1) done to quiet some compiler, and 2) fix it
properly so all things are quiet about it.

-	nvlist_t *nvl, *prev;
+	nvlist_t *nvl;
+	nvlist_t *prev = NULL;	/* Quiet gcc foo.bar XXX */

>  	int flags;
>  

Or even less intrusive would of been to put this one line add in
leaving the declarations untouched.  I think this would be the prefered
mothod for these types of things.

+	*prev = NULL;	/* Quiet gcc foo.bar XXX */
>  	NVPAIR_ASSERT(nvp);
> 

Thanks,
-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the svn-src-all mailing list