blob: 681c43da0d4f03d70c50cd1087055e89f55b5435 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 876fe5680d77800426f8c4c5680a235732d722e6 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Mon, 24 Aug 2015 17:37:54 +0800
4Subject: [PATCH] ltrace: fix gcc 5 logical not parentheses
5
6Upstream-Status: Pending
7
8Build ltrace with gcc 5.2, it fails with:
9
10error: logical not is only applied to the left hand side of comparison
11[-Werror=logical-not-parentheses]
12 if (!need_data(data, offset, SIZE / 8) < 0) \
13 ^
14
15Function need_data just return 0 on success and -1 if fail. So it is ok
16to just test if (need_data(data, offset, SIZE / 8) < 0).
17
18Signed-off-by: Kai Kang <kai.kang@windriver.com>
19---
20 ltrace-elf.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/ltrace-elf.c b/ltrace-elf.c
24index c571d2a..7fe830f 100644
25--- a/ltrace-elf.c
26+++ b/ltrace-elf.c
27@@ -218,7 +218,7 @@ need_data(Elf_Data *data, GElf_Xword offset, GElf_Xword size)
28 int \
29 NAME(Elf_Data *data, GElf_Xword offset, uint##SIZE##_t *retp) \
30 { \
31- if (!need_data(data, offset, SIZE / 8) < 0) \
32+ if (need_data(data, offset, SIZE / 8) < 0) \
33 return -1; \
34 \
35 if (data->d_buf == NULL) /* NODATA section */ { \
36--
371.9.1
38