pesign/0013-Turn-off-free-nonheap-object.patch
DistroBaker 81dc1673e1 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/pesign.git#f7bf001e4566378fc6095e299e01951d1c99dfda
2020-12-10 01:33:41 +01:00

36 lines
1.4 KiB
Diff

From 59428daf4863f192419eee4afec15cd099e99c9b Mon Sep 17 00:00:00 2001
From: Jeff Law <law@redhat.com>
Date: Mon, 16 Nov 2020 12:07:59 -0700
Subject: [PATCH] Turn off -Wfree-nonheap-object
authvar.c has a call to free (tokenname) where tokenname is set to a string constant
and never changed. That triggers GCC to issue a diagnostic that the value should not
be passed to free.
This is a false positive from GCC as the call is guarded by a suitable condition that
always happens to be false. But pesign is being built without optimization and thus
the condition and free call are not optimized away.
This patch just disables the warning. A better solution would be to fix the sources
or build with the optimizer enabled.
---
Make.defaults | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Make.defaults b/Make.defaults
index d4cd626..705cc3a 100644
--- a/Make.defaults
+++ b/Make.defaults
@@ -40,7 +40,7 @@ gcc_cflags = -Wmaybe-uninitialized -grecord-gcc-switches -flto
cflags = $(CFLAGS) $(ARCH3264) \
-Wall -Wextra -Wsign-compare -Wno-unused-result \
-Wno-unused-function -Wno-missing-field-initializers \
- -Werror -Wno-error=cpp \
+ -Werror -Wno-error=cpp -Wno-free-nonheap-object \
-std=gnu11 -fshort-wchar -fPIC -fno-strict-aliasing \
-D_GNU_SOURCE -DCONFIG_$(ARCH) -I${TOPDIR}/include \
$(if $(filter $(CC),clang),$(clang_cflags), ) \
--
2.28.0