diff options
author | Robin Jarry <robin@jarry.cc> | 2023-05-07 00:37:28 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-05-11 11:03:28 +0200 |
commit | d5f6b68df16f57f2a5bdc87c903d239454d6c3e8 (patch) | |
tree | 89ae04a961bd9da1de75314eb3875877f3a1c9e0 /.builds/alpine-edge.yml | |
parent | 3c1703f0f7ed39553deb601c0c7cd5084188558d (diff) | |
download | aerc-d5f6b68df16f57f2a5bdc87c903d239454d6c3e8.tar.gz |
filters: fix option parsing on arm cpus
When running colorize or wrap on ARM, both programs exit immediately
displaying their help message whatever the provided arguments. This is
caused by an implicit downcast of the getopt return value.
On most architectures, char is signed by default. On ARM, char is
unsigned for performance reasons. Since the signed int return value of
getopt is forced into a char, the results differ on ARM compared to x86.
* Add -Wconversion -Warith-conversion to CFLAGS in CI builds to ensure
catching such issues in the future.
* Fix all -Wconversion -Warith-conversion reported issues.
* Wide char functions need to deal with wint_t and wchar_t and it is
guaranteed that a wchar_t can always fit into a wint_t. Add explicit
casts to silence the reported warnings.
Link: https://www.arm.linux.org.uk/docs/faqs/signedchar.php
Link: https://lwn.net/Articles/911914/
Fixes: https://todo.sr.ht/~rjarry/aerc/164
Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Suggested-by: Allen Sobot <chilledfrogs@disroot.org>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to '.builds/alpine-edge.yml')
-rw-r--r-- | .builds/alpine-edge.yml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.builds/alpine-edge.yml b/.builds/alpine-edge.yml index 0f097c53..9433a808 100644 --- a/.builds/alpine-edge.yml +++ b/.builds/alpine-edge.yml @@ -12,7 +12,7 @@ environment: DESTDIR: ./out GOFLAGS: "-tags=notmuch" CC: gcc - CFLAGS: -O2 -g -Wall -Wextra -Werror -Wformat-security -Wstack-protector -fstack-protector-strong -fanalyzer + CFLAGS: -O2 -g -Wall -Wextra -Wconversion -Warith-conversion -Werror -Wformat-security -Wstack-protector -fstack-protector-strong -fanalyzer FILTERS_TEST_PREFIX: valgrind --leak-check=full --error-exitcode=1 tasks: - lint: | |