Bug 11748 - Build failure with xlc 13.1.3, designated initializer bug
Build failure with xlc 13.1.3, designated initializer bug
Status: RESOLVED WONTFIX
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.3.5
PPC AIX
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-23 18:34 UTC by Guillaume Xavier Taillon
Modified: 2016-07-30 02:34 UTC (History)
3 users (show)

See Also:


Attachments
Proposed patch (4.63 KB, patch)
2016-02-23 18:36 UTC, Guillaume Xavier Taillon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Xavier Taillon 2016-02-23 18:34:14 UTC
Build failure with xlc 13.1.3, designated initializer bug
AIX Version: 7100-03-05-1524
XLC Version: 13.01.0003.0000
Samba Version: 4.3.5

[1927/3435] Compiling source4/torture/smb2/lock.c                               
"../source4/torture/smb2/lock.c", line 2897.35: 1506-196 (S) Initialization
between types "unsigned long long" and "struct smb2_handle" is not allowed.
"../source4/torture/smb2/lock.c", line 2919.35: 1506-196 (S) Initialization
between types "unsigned long long" and "struct smb2_handle" is not allowed.
Waf: Leaving directory `/usr/src/samba-4.3.5/bin'
Build failed:  -> task failed (err #1):     
        {task: cc lock.c -> lock_1.o}                      
make: 1254-004 The error code from the last command is 1.


Stop.

This is a bug in xlc, a PMR has been opened to get it fixed.
Adding curly brackets around the problematic fields fixes the bug (see patch).

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
Comment 1 Guillaume Xavier Taillon 2016-02-23 18:36:59 UTC
Created attachment 11866 [details]
Proposed patch
Comment 2 Peter 2016-05-11 12:37:34 UTC
This also applies to Samba 4.4.3 with xlc compiler 13.1.3
This patch works correctly
Comment 3 Andrew Bartlett 2016-07-30 02:34:40 UTC
Per discussion on samba-technical, this won't be fixed in Samba, we require this feature and will instead hope XLC supports this soon.

https://lists.samba.org/archive/samba-technical/2016-March/112679.html