https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119011

--- Comment #12 from Paul Eggert <eggert at cs dot ucla.edu> ---
On 2/26/25 07:29, vincent-gcc at vinc17 dot net wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119011
> 
> --- Comment #11 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
> (In reply to Alejandro Colomar from comment #10)
> [about i + 1 == 0 instead of i == -1]
>> But this causes readability issues.  For error-handling, programmers are
>> used to writing ==-1, and doing +1==0 would be significantly weird.  Given
>> that comparison ==-1 isn't unsafe in any way (given that the LHS is of rank
>> no less than int), we should stop warning about it.
> 
> OK. I completely agree.
> 

Plus, i + 1 == 0 does not necessarily work if time_t is 'unsigned short' 
(yes that'd be really weird for time_t, but ISO C and POSIX allow it and 
I try to write to the standards, and the problem has come up with other 
system types).

Reply via email to