From e4515e580a98c72fbb21706d167553387f36feaa Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 22 Aug 2021 15:29:12 -0500 Subject: [PATCH] Omit all non-standard stuff from if __KeepNamespacePure__ is defined. This affects the toint function and the _tolower and _toupper macros. Several other non-standard functions and macros were already being omitted. --- ORCACDefs/ctype.h | 8 +++++--- cc.notes | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ORCACDefs/ctype.h b/ORCACDefs/ctype.h index ee87f52..88e9e51 100644 --- a/ORCACDefs/ctype.h +++ b/ORCACDefs/ctype.h @@ -81,11 +81,13 @@ int isblank(int); #define isblank(c) ((__ctype2)[(c)+1] & __blank) #ifndef __KeepNamespacePure__ #define toascii(c) ((c) & 0x7F) + int toint(char); #endif -int toint(char); int tolower(int); int toupper(int); -#define _tolower(c) ((c) | 0x20) -#define _toupper(c) ((c) & 0x5F) +#ifndef __KeepNamespacePure__ + #define _tolower(c) ((c) | 0x20) + #define _toupper(c) ((c) & 0x5F) +#endif #endif diff --git a/cc.notes b/cc.notes index 1c95cad..42902c6 100644 --- a/cc.notes +++ b/cc.notes @@ -1172,7 +1172,7 @@ int foo(int[42]); 146. In initializers for static data, expressions where an integer with unsigned type was added to an array address (e.g. "a + 1U") would not be accepted. -147. The header includes several non-standard functions. Their declarations should be omitted if __KeepNamespacePure__ is defined. +147. The and headers include several non-standard functions and macros. Their declarations and definitions should be omitted if __KeepNamespacePure__ is defined. 148. When an expression that the intermediate code peephole optimizer could reduce to a constant was cast to a character type, the resulting value could be outside the range of that type.