Re: git: 1c7ac0c23bc1 - main - veriexec: fix use of getopt

From: Alexey Dokuchaev <danfe_at_freebsd.org>
Date: Mon, 17 Apr 2023 05:25:36 UTC
On Mon, Apr 17, 2023 at 01:05:00AM +0000, Stephen J. Kiernan wrote:
> commit 1c7ac0c23bc12cc7cd5776fa28ebe0582e1bccec
> 
>   veriexec: fix use of getopt
> 
>   getopt(3) returns int type not char. Using char triggers the
>   -Wtautological-constant-out-of-range-compare warning with clang.

Not just that, depending on the usage (e.g. if there is == -1 check),
it could be broken on machines where char is unsigned by default.

This is one of those things I could never understand: getopt(3) is
said to return `int' by the standard and the manpage, but people
keep assigning it to `char' (go figure).

./danfe