nixpkgs-overlay/gust_tools/0001-gust_ebm-fix-compiler-...

35 lines
1.3 KiB
Diff
Raw Normal View History

2021-08-11 23:56:43 +02:00
From 08a150625260fb684ec33f2a1d1489e2e277903a Mon Sep 17 00:00:00 2001
From: Simon Bruder <simon@sbruder.de>
Date: Wed, 11 Aug 2021 23:44:07 +0200
Subject: [PATCH] gust_ebm: fix compiler error about different signs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC 10 currently fails with this error:
gust_ebm.c: In function main_utf8:
gust_ebm.c:85:49: error: comparison of integer expressions of different signedness: size_t {aka long unsigned int} and int [-Werror=sign-compare]
85 | if (json_array_get_count(json_messages) != abs(nb_messages)) {
| ^~
---
gust_ebm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gust_ebm.c b/gust_ebm.c
index 35ca4f2..7a4cf51 100644
--- a/gust_ebm.c
+++ b/gust_ebm.c
@@ -82,7 +82,7 @@ int main_utf8(int argc, char** argv)
goto out;
}
JSON_Array* json_messages = json_object_get_array(json_object(json), "messages");
- if (json_array_get_count(json_messages) != abs(nb_messages)) {
+ if (json_array_get_count(json_messages) != (unsigned int)abs(nb_messages)) {
fprintf(stderr, "ERROR: Number of messages doesn't match the array size\n");
goto out;
}
--
2.31.1