[PATCH] AIX Fix xlc designated initializer bug

Andreas Schneider asn at samba.org
Wed Mar 2 10:02:41 UTC 2016


On Tuesday 01 March 2016 16:45:07 Michael Adam wrote:
> On 2016-03-01 at 14:46 +0000, Guillaume G Taillon wrote:
> > It took me a while to figure out what was going on... You can take a look
> > at the snippet I sent to the compiler team (they confirmed to me that they
> > were able to reproduce the problem). Judging from the error, xlc seems to
> > try to assign the member (.data which is uint64_t -> unsigned long long)
> > of the struct instead of the struct itself.
> 
> Uh. That sounds like a compiler bug, doesn't it?
> But generally, the resulting binaries do work, right? :-)
> 
> > Assigning more members looks good but what about the .handle ones? They
> > don't have any siblings to be grouped with.
> 
> Right... At first sight I only looked at the .context.pid
> example. :-)
> 
> We could go with the patch.
> But I'd like to understand better why we need it. ;-)
> And afaik, these struct initializers may have a subtle side
> effect of initializing all other struct members to 0 values.
> Probably not an issue, but I thought I'd mention it.
> 
> Opinions of other developers?
> Should we just take Guillaume's patch and not ask any further?
> ;-)

We agreed to use C99 some time ago. If a compiler doesn't support it, well 
then it is a pity but simply will not work on that platform.

If IBM wants Samba to be working on AIX with a different compiler than 
gcc/clang they should make sure they support C99 correctly.

Just my 2 cents ...


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160302/279763bb/signature.sig>


More information about the samba-technical mailing list