Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From 876fe5680d77800426f8c4c5680a235732d722e6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Kai Kang <kai.kang@windriver.com> |
| 3 | Date: Mon, 24 Aug 2015 17:37:54 +0800 |
| 4 | Subject: [PATCH] ltrace: fix gcc 5 logical not parentheses |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Build ltrace with gcc 5.2, it fails with: |
| 9 | |
| 10 | error: 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 | |
| 15 | Function need_data just return 0 on success and -1 if fail. So it is ok |
| 16 | to just test if (need_data(data, offset, SIZE / 8) < 0). |
| 17 | |
| 18 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 19 | --- |
| 20 | ltrace-elf.c | 2 +- |
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 22 | |
| 23 | diff --git a/ltrace-elf.c b/ltrace-elf.c |
| 24 | index 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 | -- |
| 37 | 1.9.1 |
| 38 | |