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: =?UTF-8?Q?J=C3=B6rg_Sonnenberger?= <joerg%bec.de@localhost>
To: gnats-bugs%netbsd.org@localhost, lib-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/58913: ctype(3) macros fail on (unsigned)EOF
Date: Wed, 18 Dec 2024 10:51:28 +0100

 > 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 think the standard requires any explicit cast to int for 
 macro-like implementations. As such the code is just as broken as the 
 sadly too common pattern of isspace((int)ch).
 
 Joerg
 


Home | Main Index | Thread Index | Old Index