[PATCH] H8: Minor cleanup in newlib/libc/include/sys/config.h.

Jan Dubiec jdx@o2.pl
Wed Jul 15 23:23:22 GMT 2026


On 15.07.2026 01:57, Jeff Johnston wrote:
> Hi Jan,
> 
> Even though the H8300 flag isn't used within newlib, it is possible user 
> code could be referring to it since it is made available

IMO, it's unlikely, since the compiler already provides the __H8300H__, 
__H8300S__, and __H8300SX__ macros. But it's not a big deal.

> via the header file.  If the first definition is wrong, that one can be 
> removed, but in the 2nd case, it appears to be correct.
Do you mean something like in the attached patch?

/J.D.

-------------- next part --------------
 newlib/libc/include/sys/config.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index c3cd51e86..e9e8c0b96 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -20,9 +20,6 @@
 /* exceptions first */
 #if defined(__H8500__) || defined(__W65__)
 #define __SMALL_BITFIELDS
-/* ???  This conditional is true for the h8500 and the w65, defining H8300
-   in those cases probably isn't the right thing to do.  */
-#define H8300 1
 #endif
 
 /* 16 bit integer machines */
@@ -41,11 +38,14 @@
 #undef UINT_MAX
 #define INT_MAX __INT_MAX__
 #define UINT_MAX (__INT_MAX__ * 2U + 1)
+#define _POINTER_INT __INTPTR_TYPE__
+#define _READ_WRITE_RETURN_TYPE _ssize_t
+#define _READ_WRITE_BUFSIZE_TYPE size_t
 #endif
 
 #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
 #ifndef __INT32__
-#define __SMALL_BITFIELDS      
+#define __SMALL_BITFIELDS
 #undef INT_MAX
 #undef UINT_MAX
 #define INT_MAX 32767


More information about the Newlib mailing list