Bug 11748 - Build failure with xlc 13.1.3, designated initializer bug
Summary: Build failure with xlc 13.1.3, designated initializer bug
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.3.5
Hardware: PPC AIX
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-23 18:34 UTC by Guillaume Xavier Taillon (mail address dead)
Modified: 2018-02-21 00:15 UTC (History)
4 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Xavier Taillon (mail address dead) 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 (mail address dead) 2016-02-23 18:36:59 UTC
Created attachment 11866 [details]
Proposed patch
Comment 2 Peter (mail address dead) 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