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
This commit is contained in:
DJ Delorie 2020-02-06 16:07:42 -05:00
parent 26dcb3847a
commit d258184038
2 changed files with 24 additions and 1 deletions

View File

@ -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:

View File

@ -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 <dj@redhat.com> - 0.7.91-37
- Initialize some variables to avoid gcc warning (#1799619)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.91-36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild