This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: h8300-elf: Incorrect value of UINT_MAX for -mh -mint32 target.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: niting at noida dot hcltech dot com
- Cc: newlib at sources dot redhat dot com, dvenkat at noida dot hcltech dot com
- Date: Fri, 13 Dec 2002 11:36:21 -0500 (EST)
- Subject: Re: h8300-elf: Incorrect value of UINT_MAX for -mh -mint32 target.
- References: <E04CF3F88ACBD5119EFE00508BBB212106208629@exch-01.noida.hcltech.com>
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__