Bug 771522 - libselinux patch causes build errors with -Werror=missing-braces
libselinux patch causes build errors with -Werror=missing-braces
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: libselinux (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-03 18:47 EST by Peter Hutterer
Modified: 2012-01-04 11:03 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-01-04 11:03:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
How does this look? (3.05 KB, application/x-troff-man)
2012-01-04 11:01 EST, Daniel Walsh
no flags Details

  None (edit)
Description Peter Hutterer 2012-01-03 18:47:22 EST
libselinux-rhat.patch changes struct selinux_opt from { int, char* } to { int, union { char*, char** }}. This causes code in the following form to fail when -Werror=missing-braces is in the CFLAGS.

  struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, (char *)1 };

xselinux_hooks.c: In function 'SELinuxFlaskInit':
xselinux_hooks.c:851:12: error: missing braces around initializer
[-Werror=missing-braces]
xselinux_hooks.c:851:12: error: (near initialization for
'avc_option.<anonymous>') [-Werror=missing-braces]
cc1: some warnings being treated as errors

Example taken from the X server, we just switched to -Werror=missing-braces. 

The hard bit was tracking this down since all the man pages still refer to the old struct form (and I could only trigger the error on koji at first), and my F16 machine has the old struct.

Not sure if you want to do anything about it, but if this is a long-standing patch, updating the man pages would be useful.
Comment 1 Daniel Walsh 2012-01-04 11:01:16 EST
Created attachment 550708 [details]
How does this look?
Comment 2 Daniel Walsh 2012-01-04 11:03:51 EST
Fixed in libselinux-2.1.9-2.fc17

Note You need to log in before you can comment on or make changes to this bug.