[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: standards/46276: CHAR_MAX/CHAR_MIN don't change with -funsigned-char
On Mar 28, 6:35pm, dholland-bugs%netbsd.org@localhost (David Holland) wrote:
-- Subject: Re: standards/46276: CHAR_MAX/CHAR_MIN don't change with -funsign
| The following reply was made to PR standards/46276; it has been noted by
| From: David Holland <dholland-bugs%netbsd.org@localhost>
| To: gnats-bugs%netbsd.org@localhost
| Subject: Re: standards/46276: CHAR_MAX/CHAR_MIN don't change with
| Date: Wed, 28 Mar 2012 18:32:52 +0000
| On Wed, Mar 28, 2012 at 06:25:00PM +0000, dholland%netbsd.org@localhost
| > Move the definitions of CHAR_MIN/CHAR_MAX out of MD limits.h and use
| > something gcc-provided to pick the signed or unsigned values. If gcc
| > doesn't provide a way to check at runtime, I guess we need to add one.
| uwe says gcc provides __CHAR_UNSIGNED__ to test with.
| In both gcc 4.1 and 4.5 the "#if ('7' - '8') < 0" test can be used to
| determine if char is unsigned, but there is still a question as to
| whether this is correct gcc behavior.
We have __type_is_signed(char) in <sys/cdefs.h>, but in this case it is better
to use the gcc macro, which I already did before this PR was filed :-)
Main Index |
Thread Index |