NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/58913: ctype(3) macros fail on (unsigned)EOF



The following reply was made to PR lib/58913; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/58913: ctype(3) macros fail on (unsigned)EOF
Date: Wed, 18 Dec 2024 13:06:12 +0100

 On Wed, Dec 18, 2024 at 02:25:01AM +0000, campbell+netbsd%mumble.net@localhost wrote:
 
 > If you call such a function as isspace((unsigned)EOF), the effect
 > should be identical to calling it as isspace((int)(unsigned)EOF) or
 > just isspace(EOF), since EOF is specified to expand to an integer
 > constant expression with type int (and a negative value).
 
 I don't follow your "since" part here and disagree with the "should"
 part.
 
 I would read the (unsigned) cast of the negative integer value as undefined
 behaviour.
 
 Martin
 


Home | Main Index | Thread Index | Old Index