082b752
From 4b3dc6b38abbd32cda557d5ef9ea1383ac5fdcf2 Mon Sep 17 00:00:00 2001
fdd5e43
From: rpm-build <rpm-build>
fdd5e43
Date: Thu, 23 Feb 2017 08:17:07 +0100
082b752
Subject: [PATCH 2/3] Do not use -Werror during build
fdd5e43
MIME-Version: 1.0
fdd5e43
Content-Type: text/plain; charset=UTF-8
fdd5e43
Content-Transfer-Encoding: 8bit
fdd5e43
fdd5e43
There are new warnings when setools are built with gcc 7 therefore we
fdd5e43
want to suppress -Werror for now
fdd5e43
fdd5e43
Fixes:
fdd5e43
libqpol/policy_extend.c: In function ‘policy_extend’:
fdd5e43
libqpol/policy_extend.c:161:27: error: ‘%04zd’ directive output may be truncated writing between 4 and 10 bytes into a region of size 5 [-Werror=format-truncation=]
fdd5e43
    snprintf(buff, 9, "@ttr%04zd", i + 1);
fdd5e43
                           ^~~~~
fdd5e43
libqpol/policy_extend.c:161:22: note: directive argument in the range [1, 4294967295]
fdd5e43
    snprintf(buff, 9, "@ttr%04zd", i + 1);
fdd5e43
                      ^~~~~~~~~~~
fdd5e43
In file included from /usr/include/stdio.h:939:0,
fdd5e43
                 from /usr/include/sepol/policydb/policydb.h:53,
fdd5e43
                 from libqpol/policy_extend.c:29:
fdd5e43
/usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 9 and 15 bytes into a destination of size 9
fdd5e43
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
fdd5e43
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fdd5e43
        __bos (__s), __fmt, __va_arg_pack ());
fdd5e43
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fdd5e43
cc1: all warnings being treated as errors
fdd5e43
error: command 'gcc' failed with exit status 1
fdd5e43
---
fdd5e43
 setup.py | 2 +-
fdd5e43
 1 file changed, 1 insertion(+), 1 deletion(-)
fdd5e43
fdd5e43
diff --git a/setup.py b/setup.py
082b752
index c94daf1..a7442ac 100644
fdd5e43
--- a/setup.py
fdd5e43
+++ b/setup.py
082b752
@@ -105,7 +105,7 @@ ext_py_mods = [Extension('setools.policyrep', ['setools/policyrep.pyx'],
082b752
                          libraries=['selinux', 'sepol'],
082b752
                          library_dirs=lib_dirs,
082b752
                          define_macros=macros,
fdd5e43
-                         extra_compile_args=['-Werror', '-Wextra',
fdd5e43
+                         extra_compile_args=['-Wextra',
fdd5e43
                                              '-Waggregate-return',
fdd5e43
                                              '-Wfloat-equal',
13a8a83
                                              '-Wformat', '-Wformat=2',
fdd5e43
-- 
082b752
2.17.2
fdd5e43