NetBSD-Bugs archive

[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



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

From: Klaus Klein <kleink%kleink.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: standards/46276: CHAR_MAX/CHAR_MIN don't change with
 -funsigned-char
Date: Wed, 28 Mar 2012 22:10:10 +0200

 On Wed, Mar 28, 2012 at 06:35:02PM +0000, David Holland wrote:
 
 >  uwe says gcc provides __CHAR_UNSIGNED__ to test with.
 
 Which I'd rather use.[*]
 
 >  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.
 
 This would be implementation-defined; cpp.info documents this
 particular choice of behavior.
 
 [*] For arguably being the lesser of two implementation-defined evils...
 
 
 - Klaus
 


Home | Main Index | Thread Index | Old Index