h8300-elf: Incorrect value of UINT_MAX for -mh -mint32 target .
Kazu Hirata
kazu@cs.umass.edu
Mon Dec 16 13:28:00 GMT 2002
Hi Jeff,
> I assume that __H8300__ was meant to be added to the H3800 macros
> below - correct? It has been removed from the old test but not
> added to the new code.
Correct. Thank you for pointing that out. What about the patch
below? It collects all of the H8/300 code into one block.
Kazu Hirata
Index: config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.34
diff -c -5 -r1.34 config.h
*** config.h 11 Oct 2002 10:28:30 -0000 1.34
--- config.h 16 Dec 2002 21:26:37 -0000
***************
*** 2,25 ****
#define __SYS_CONFIG_H__
#include <machine/ieeefp.h> /* floating point macros */
/* exceptions first */
! #if defined(__H8300__) || defined(__H8500__) || defined (__H8300H__) || defined(__W65__) || defined (__H8300S__)
#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 */
! #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) || defined (__AVR__)
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX 32767
#define UINT_MAX 65535
#endif
#ifdef __W65__
#define __SMALL_BITFIELDS
#endif
--- 2,34 ----
#define __SYS_CONFIG_H__
#include <machine/ieeefp.h> /* floating point macros */
/* 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 */
! #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 (__H8300__) || defined (__H8300H__) || defined(__H8300S__)
+ #define __SMALL_BITFIELDS
+ #define H8300 1
+ #undef INT_MAX
+ #undef UINT_MAX
+ #define INT_MAX __INT_MAX__
+ #define UINT_MAX (__INT_MAX__ * 2U + 1)
#endif
#ifdef __W65__
#define __SMALL_BITFIELDS
#endif
More information about the Newlib
mailing list