NetBSD-Users archive

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

Re: toupper and warnings



On Thu, May 06, 2021 at 09:26:33AM +0200, Johnny Billquist wrote:
> I'm not sure I understand why you'd get a warning in the first place.
> toupper should take an int as input. Which is signed.
> If you pass in a char, it should always fit and work.
> Why should you get a warning?

Because the function requires an unsigned char or EOF and is undefined
for everything else.

See CAVEATS in ctype(3).

Martin


Home | Main Index | Thread Index | Old Index