Bug 771522 - libselinux patch causes build errors with -Werror=missing-braces
Summary: libselinux patch causes build errors with -Werror=missing-braces
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libselinux
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-03 23:47 UTC by Peter Hutterer
Modified: 2012-01-04 16:03 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-01-04 16:03:51 UTC
Type: ---
Embargoed:


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

Description Peter Hutterer 2012-01-03 23:47:22 UTC
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 16:01:16 UTC
Created attachment 550708 [details]
How does this look?

Comment 2 Daniel Walsh 2012-01-04 16:03:51 UTC
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.