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 /go.sum | |
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 'go.sum')
0 files changed, 0 insertions, 0 deletions