[PATCH] AIX Fix xlc designated initializer bug
Guillaume G Taillon
gtaillon at ca.ibm.com
Tue Mar 1 14:46:08 UTC 2016
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.
Assigning more members looks good but what about the .handle ones? They
don't have any siblings to be grouped with.
gxt
De : Michael Adam <obnox at samba.org>
A : Guillaume G Taillon/Bromont/IBM at IBMCA
Cc : samba-technical at lists.samba.org
Date : 02/29/2016 04:52 PM
Objet : Re: [PATCH] AIX Fix xlc designated initializer bug
Envoyé par : "samba-technical"
<samba-technical-bounces at lists.samba.org>
I don't get it.
The error message from the patch says:
"../source3/locking/brlock.c", line 1034.32: 1506-196 (S)
Initialization between types "unsigned long long" and
"struct server_id" is not allowed. [...]
why unsigned long long? pid is struct server_id, and
so is the member of context. So the problem description
sounds fishy to me..
If that fixes it, you could initialize the context
struct with more members in one assignment like so:
lock = (struct lock_struct) {
.context = {
.smblctx = smblctx,
.pid = pid,
.tid = br_lck->fsp->conn->cnum,
},
.start = start,
...
}
how about that?
Cheers - Michael
On 2016-02-29 at 21:13 +0000, Guillaume G Taillon wrote:
> This is a bug in xlc, a PMR has been opened to get it fixed.
> The workaround is to add curly brackets around the problematic fields.
>
> Is this too simple a fix? I considered using #ifs but 5 lines for a
> syntactic
> problem seemed too gross for me. Eg (not tested):
>
> #define IBMC_COMPAT_INITIALIZERS 1313
> [...]
> #if defined(__IMBC__) && __IBMC__ <= IBMC_COMPAT_INITIALIZERS
> .context = {.pid = pid},
> #else
> .context.pid = pid,
> #endif
>
> https://bugzilla.samba.org/show_bug.cgi?id=11748
>
>
>
> gxt
[attachment "signature.asc" deleted by Guillaume G Taillon/Bromont/IBM]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diat2.c
Type: application/octet-stream
Size: 413 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160301/218a3fc5/diat2.obj>
More information about the samba-technical
mailing list