Re: [PATCH v4 01/10] doc: define unambiguous type mappings across C and Rust
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 15, 2025, 16:42 UTC
- Message-ID
- <xmqqpl9jfdso.fsf@gitster.g>
- In-Reply-To
- <a30ad114-61c2-4eed-a24e-033b3b9d6d0c@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 8 quoted lines
>> This was discussed briefly in replies to v2’s 2/10, where >> Ezekiel said that DEVELOPER=1 warned about sign issues whether >> char was compared to int or unsigned. [From mobile I cannot >> reliably paste the message ID or link and preserve a plain-text >> email, apologies for the oblique reference.] > > Err... sorry, but I don't see how this comment relates to my > email. puzzled! ;)
Me neither, but I suspect it may mostly use of non-word "signless" that is the issue. It is understandable for the -Wsign-compare warning (especially given that it very often complains about perfectly good pieces of code) to complain when you compare a "char" with a signed integer, saying "on a platform where 'char' is unsigned, you would be comparing signed and unsigned values with this expression", and at the same time complain when you compare a "char" with an unsigned integer, saying "on a platform where 'char' is signed...".
I'd say it shows more about how garbage -Wsign-compare is than about how 'char' is ambiguous and should be avoided, but others may have different opinions.