s3/loadparm: Fix severe HPUX compiler issue. (Explicitly initilise all elements in C99 structures)

Andrew Bartlett abartlet at samba.org
Tue Oct 13 15:16:15 MDT 2009


On Tue, 2009-10-13 at 11:39 -0500, Karolin Seeger wrote:
> The branch, master has been updated
>        via  5ec557d... s3/loadparm: Fix severe HPUX compiler issue.
>       from  11a8a54... s4:hdb-samba4 - Don't double-free "db"
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -----------------------------------------------------------------
> commit 5ec557d9f6137dc96b2c099fb13726e6552fb1fe
> Author: Olaf Flebbe <o.flebbe at science-computing.de>
> Date:   Tue Oct 13 14:13:06 2009 +0200
> 
>     s3/loadparm: Fix severe HPUX compiler issue.
>     
>     Members of struct should be initialized explictly.
>     Fixes bug #6804.
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  source3/param/loadparm.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
> index 7bac72e..fa0577b 100644
> --- a/source3/param/loadparm.c
> +++ b/source3/param/loadparm.c
> @@ -3275,6 +3275,8 @@ static struct parm_struct parm_table[] = {
>  		.type		= P_LIST,
>  		.p_class	= P_GLOBAL,
>  		.ptr		= &Globals.szInitLogonDelayedHosts,
> +		.special        = NULL,
> +		.enum_list	= NULL,
>  		.flags		= FLAG_ADVANCED,
>  	},

I realise it's a small fix here, but if we follow this to it's natural
conclusion, we will undo one of the main reasons we shifted to C99
structure initilisation in the first place.  

Is this just going to be a one-off, or will this particular compiler
requirement follow us around the whole codebase?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20091014/152b8b26/attachment.pgp>


More information about the samba-technical mailing list