From d2581840384951145c9a8979df82390661e474d9 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 6 Feb 2020 16:07:42 -0500 Subject: [PATCH] Initialize some variables to avoid gcc warning GCC cannot follow the logic that determines if it's safe to free lrhs in expr.c. Initializing these variables to NULL silences this warning. Resolves: #1799619 --- ltrace-0.7.91-rh1799619.patch | 16 ++++++++++++++++ ltrace.spec | 9 ++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ltrace-0.7.91-rh1799619.patch diff --git a/ltrace-0.7.91-rh1799619.patch b/ltrace-0.7.91-rh1799619.patch new file mode 100644 index 0000000..ceef540 --- /dev/null +++ b/ltrace-0.7.91-rh1799619.patch @@ -0,0 +1,16 @@ +diff -rup a/expr.c b/expr.c +--- a/expr.c 2013-10-10 08:43:55.000000000 -0400 ++++ b/expr.c 2020-02-06 17:05:40.658679755 -0500 +@@ -189,10 +189,10 @@ int + expr_clone(struct expr_node *retp, const struct expr_node *node) + { + *retp = *node; ++ struct expr_node *nlhs; ++ struct expr_node *nrhs = NULL; + + switch (node->kind) { +- struct expr_node *nlhs; +- struct expr_node *nrhs; + + case EXPR_OP_ARGNO: + case EXPR_OP_SELF: diff --git a/ltrace.spec b/ltrace.spec index b5ea596..4b1dd35 100644 --- a/ltrace.spec +++ b/ltrace.spec @@ -1,7 +1,7 @@ Summary: Tracks runtime library calls from dynamically linked executables Name: ltrace Version: 0.7.91 -Release: 36%{?dist} +Release: 37%{?dist} URL: http://ltrace.alioth.debian.org/ License: GPLv2+ @@ -123,6 +123,9 @@ Patch33: ltrace-0.7.91-testsuite-system_call_params.patch # Ignore bogus files from the environment Patch34: ltrace-0.7.91-XDG_CONFIG_DIRS.patch +# GCC erroneously warns about uninitialized values +Patch35: ltrace-0.7.91-rh1799619.patch + %description Ltrace is a debugging program which runs a specified command until the command exits. While the command is executing, ltrace intercepts and @@ -169,6 +172,7 @@ execution of processes. %patch32 -p1 %patch33 -p1 %patch34 -p1 +%patch35 -p1 %build autoreconf -i @@ -196,6 +200,9 @@ echo ====================TESTING END===================== %{_datadir}/ltrace %changelog +* Thu Feb 6 2020 DJ Delorie - 0.7.91-37 +- Initialize some variables to avoid gcc warning (#1799619) + * Wed Jan 29 2020 Fedora Release Engineering - 0.7.91-36 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild