This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: RTEMS patch sweep: bogus implicit int32 in libm
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: "J. Johnston" <jjohnstn at redhat dot com>
- Cc: Newlib List <newlib at sources dot redhat dot com>, Joel Sherrill <joel dot sherrill at OARcorp dot com>, Eric Norum <norume at aps dot anl dot gov>, Chris Johns <chrisj at rtems dot org>
- Date: Fri, 25 Feb 2005 06:22:56 +0100
- Subject: Re: RTEMS patch sweep: bogus implicit int32 in libm
- References: <1109235028.15959.138.camel@mccallum.corsepiu.local> <421E253F.8000008@redhat.com>
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