Browse Source

Fix a number of compile time warnings so that uClibc will build with -Werror using
a 3.0.4 version of the sh-linux-gcc compiler.

David McCullough 22 years ago
parent
commit
bea67a752d

+ 2 - 2
include/features.h

@@ -422,8 +422,8 @@ uClibc was built without large file support enabled.
 #define __builtin_expect(x, expected_value) (x)
 #endif
 
-#define likely(x)       __builtin_expect((x),1)
-#define unlikely(x)     __builtin_expect((x),0)
+#define likely(x)       __builtin_expect(((int)(x)),1)
+#define unlikely(x)     __builtin_expect(((int)(x)),0)
 
 /* --- this is added to integrate linuxthreads */
 #define __USE_UNIX98            1

+ 1 - 1
libc/stdio/printf.c

@@ -764,7 +764,7 @@ extern int _ppfs_parsespec(ppfs_t *ppfs)
 	int n;
 	int argtype[MAX_ARGS_PER_SPEC+2];
 	int argnumber[3];			/* width, precision, 1st data arg */
-	unsigned int conv_num;
+	unsigned int conv_num = 0;
 	static const char spec_flags[] = SPEC_FLAGS;
 	static const char spec_chars[] = SPEC_CHARS;/* TODO: b? */
 	static const char spec_ranges[] = SPEC_RANGES;

+ 1 - 0
libc/sysdeps/linux/common/syscalls.c

@@ -35,6 +35,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
+#include <endian.h>
 
 
 //#define __NR_exit             1

+ 3 - 1
libc/sysdeps/linux/sh/longjmp.c

@@ -24,6 +24,8 @@
 #include <setjmp.h>
 #include <signal.h>
 
+extern int __longjmp(char *env, int val);
+extern int __sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
 
 /* Set the signal mask to the one specified in ENV, and jump
    to the position specified in ENV, causing the setjmp
@@ -36,7 +38,7 @@ void __libc_siglongjmp (sigjmp_buf env, int val)
 			  (sigset_t *) NULL);
 
   /* Call the machine-dependent function to restore machine state.  */
-  __longjmp (env[0].__jmpbuf, val ?: 1);
+  __longjmp ((char *) env[0].__jmpbuf, val ?: 1);
 }
 
 __asm__(".weak longjmp; longjmp = __libc_siglongjmp");

+ 1 - 1
libm/e_asin.c

@@ -77,7 +77,7 @@ qS4 =  7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
 	double x;
 #endif
 {
-	double t,w,p,q,c,r,s;
+	double t=0.0,w,p,q,c,r,s;
 	int32_t hx,ix;
 	GET_HIGH_WORD(hx,x);
 	ix = hx&0x7fffffff;

+ 2 - 2
libm/e_exp.c

@@ -111,8 +111,8 @@ P5   =  4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
 #endif
 {
 	double y;
-	double hi = 0;
-	double lo = 0;
+	double hi = 0.0;
+	double lo = 0.0;
 	double c;
 	double t;
 	int32_t k=0;

+ 1 - 1
libm/e_rem_pio2.c

@@ -90,7 +90,7 @@ pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
 	double x,y[];
 #endif
 {
-	double z=0,w,t,r,fn;
+	double z=0.0,w,t,r,fn;
 	double tx[3];
 	int32_t e0,i,j,nx,n,ix,hx;
 	u_int32_t low;

+ 1 - 1
libm/s_expm1.c

@@ -138,7 +138,7 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
 	double x;
 #endif
 {
-	double y,hi,lo,c=0,t,e,hxs,hfx,r1;
+	double y,hi,lo,c=0.0,t,e,hxs,hfx,r1;
 	int32_t k,xsb;
 	u_int32_t hx;