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: RTEMS patch sweep: bogus implicit int32 in libm


On Thu, 2005-02-24 at 14:04 -0500, Jeff Johnston wrote:
> Patch checked in, thanks.  I modified it slightly to use __uint32_t for all the 
> ints you replaced (as opposed to __int32_t).

Thanks,

another similar patch is attached below.

It is supposed to fix these warnings/bugs:

/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/xgcc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/ -nostdinc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/h8300h/newlib/ -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/h8300h/newlib/targ-include -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/gcc-4.0.0/newlib/libc/include -B/opt/rtems-4.7/h8300-rtems4.7/bin/ -B/opt/rtems-4.7/h8300-rtems4.7/lib/ -isystem /opt/rtems-4.7/h8300-rtems4.7/include -isystem /opt/rtems-4.7/h8300-rtems4.7/sys-include  -mh -DPACKAGE=\"newlib\" -DVERSION=\"1.13.0\"  -I. -I../../../../../../gcc-4.0.0/newlib/libm/math  -I../../../../../../gcc-4.0.0/newlib/libm/math/../common -O2 -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL -fno-builtin      -O2 -g -O2   -mh -c ../../../../../../gcc-4.0.0/newlib/libm/math/ef_j0.c
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j0.c: In function '__ieee754_j0f':
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j0.c:68: warning: left shift count >= width of type
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j0.c: In function '__ieee754_y0f':
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j0.c:154: warning: left shift count >= width of type
/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/xgcc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc/ -nostdinc -B/users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/h8300h/newlib/ -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/h8300-rtems4.7/h8300h/newlib/targ-include -isystem /users/rtems/src/rpms/BUILD/rtems-4.7-h8300-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/gcc-4.0.0/newlib/libc/include -B/opt/rtems-4.7/h8300-rtems4.7/bin/ -B/opt/rtems-4.7/h8300-rtems4.7/lib/ -isystem /opt/rtems-4.7/h8300-rtems4.7/include -isystem /opt/rtems-4.7/h8300-rtems4.7/sys-include  -mh -DPACKAGE=\"newlib\" -DVERSION=\"1.13.0\"  -I. -I../../../../../../gcc-4.0.0/newlib/libm/math  -I../../../../../../gcc-4.0.0/newlib/libm/math/../common -O2 -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL -fno-builtin      -O2 -g -O2   -mh -c ../../../../../../gcc-4.0.0/newlib/libm/math/ef_j1.c
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j1.c: In function '__ieee754_j1f':
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j1.c:69: warning: left shift count >= width of type
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j1.c: In function '__ieee754_y1f':
../../../../../../gcc-4.0.0/newlib/libm/math/ef_j1.c:140: warning: left shift count >= width of type

IMO, this patch is a bit arguable, as explicitly casting these consts to
(__int32_t) could be more portable (What will happen on 64bit targets?)
than using "L"-constants.

Ralf

Index: libm/common/fdlibm.h
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/fdlibm.h,v
retrieving revision 1.5
diff -u -r1.5 fdlibm.h
--- libm/common/fdlibm.h	27 Jun 2002 22:48:05 -0000	1.5
+++ libm/common/fdlibm.h	25 Feb 2005 05:11:24 -0000
@@ -71,13 +71,13 @@
 #define FLT_UWORD_IS_FINITE(x) ((x)<0x7f800000L)
 #define FLT_UWORD_IS_NAN(x) ((x)>0x7f800000L)
 #define FLT_UWORD_IS_INFINITE(x) ((x)==0x7f800000L)
-#define FLT_UWORD_MAX 0x7f7fffff
+#define FLT_UWORD_MAX 0x7f7fffffL
 #define FLT_UWORD_EXP_MAX 0x43000000
 #define FLT_UWORD_LOG_MAX 0x42b17217
 #define FLT_UWORD_LOG_2MAX 0x42b2d4fc
 #define HUGE ((float)3.40282346638528860e+38)
 #endif
-#define FLT_UWORD_HALF_MAX (FLT_UWORD_MAX-(1<<23))
+#define FLT_UWORD_HALF_MAX (FLT_UWORD_MAX-(1L<<23))
 #define FLT_LARGEST_EXP (FLT_UWORD_MAX>>23)
 
 /* Many routines check for zero and subnormal numbers.  Such things depend

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