This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, RFC] Fix PR 30389 - ASCII functions


Brooks Moses wrote:
Personally, I think I'd prefer to have CHAR(0) returned for anything outside the 0-to-127 range, in both the constant-folding and runtime, but that's just me.

And, based on a reread of the standard, also not standard-conforming. Every character in the character set, whether part of ASCII or not, must have a unique result from IACHAR(), and then ACHAR() of that result must return that character.


Thus, assuming that everything is ASCII, I suggest that returning the same results as CHAR for all in-range values is appropriate. Whether we want to use the lowest eight bits or return CHAR(0) for out-of-range values is debateable; I prefer CHAR(0) but have no strong preferences.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]