[PATCH] Fix build on hosts that won't allow var = {} initialisation

Andrew Bartlett abartlet at samba.org
Fri May 24 02:09:53 MDT 2013


On Fri, 2013-05-24 at 08:39 +0200, Volker Lendecke wrote:
> On Thu, May 23, 2013 at 05:58:41PM +0200, Christian Ambach wrote:
> > On 05/23/2013 07:42 AM, Andrew Bartlett wrote:
> > >No, the patch I was proposing is attached.  What you pushed is another
> > >patch I was also proposing (I've been busy).
> > 
> > >-	struct smb_acl_wrapper acl_wrapper = {};
> > >+	/* Initialise this to zero, in a portable way */
> > >+	struct smb_acl_wrapper acl_wrapper = {
> > >+		NULL
> > >+	};
> > 
> > Why not use ZERO_STRUCT (as used elsewhere)?
> 
> ZERO_STRUCT is an explicit call to memset. With the
> explicit initialization the compiler at least has a chance
> to do it differently if it chooses so.

Thanks Volker, that puts it much better than I could express!

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list