This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib 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: h8300-elf: Incorrect value of UINT_MAX for -mh -mint32 target.


Hi Nitin,

> Instead of absoule values for INT_MAX and UINT_MAX, the macro
> __INT_MAX__ should be used for H8300 targets. The value of 
> __INT_MAX__ is appropriately defined in spec.

What about something like this?  Is __INT_MAX__ always defined?  We
should probably remove mentions of H8/300 in the preceeding block.

Kazu Hirata

Index: config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.34
diff -u -r1.34 config.h
--- config.h	11 Oct 2002 10:28:30 -0000	1.34
+++ config.h	13 Dec 2002 16:32:15 -0000
@@ -12,12 +12,19 @@
 #endif
 
 /* 16 bit integer machines */
-#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) || defined (__AVR__)
+#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__)
 
 #undef INT_MAX
 #undef UINT_MAX
 #define INT_MAX 32767
 #define UINT_MAX 65535
+#endif
+
+#if defined (__H8300H__) || defined(__H8300S__)
+#undef INT_MAX
+#undef UINT_MAX
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (__INT_MAX__ * 2U + 1)
 #endif
 
 #ifdef __W65__


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