svn commit: trunk/uClibc/libc: inet misc/time stdio

vda at uclibc.org vda at uclibc.org
Sun Jun 1 22:11:08 UTC 2008


Author: vda
Date: 2008-06-01 15:11:07 -0700 (Sun, 01 Jun 2008)
New Revision: 22174

Log:
suppress a few "might be used uninitialized" warnings. No code growth.



Modified:
   trunk/uClibc/libc/inet/ntop.c
   trunk/uClibc/libc/misc/time/time.c
   trunk/uClibc/libc/stdio/old_vfprintf.c


Changeset:
Modified: trunk/uClibc/libc/inet/ntop.c
===================================================================
--- trunk/uClibc/libc/inet/ntop.c	2008-06-01 21:52:47 UTC (rev 22173)
+++ trunk/uClibc/libc/inet/ntop.c	2008-06-01 22:11:07 UTC (rev 22174)
@@ -126,6 +126,8 @@
 		words[i / 2] = (src[i] << 8) | src[i + 1];
 	best.base = -1;
 	cur.base = -1;
+	best.len = best.len; /* shutting up compiler warning */
+	cur.len = cur.len;   /* shutting up compiler warning */
 	for (i = 0; i < 8; i++) {
 		if (words[i] == 0) {
 			if (cur.base == -1)

Modified: trunk/uClibc/libc/misc/time/time.c
===================================================================
--- trunk/uClibc/libc/misc/time/time.c	2008-06-01 21:52:47 UTC (rev 22173)
+++ trunk/uClibc/libc/misc/time/time.c	2008-06-01 22:11:07 UTC (rev 22174)
@@ -673,7 +673,7 @@
 {
 	long sec;
 	int i, isdst, isleap, day, day0, monlen, mday;
-	int oday;					/* Note: oday can be uninitialized. */
+	int oday = oday; /* ok to be uninitialized, shutting up compiler warning */
 
 	isdst = 0;
 	if (r[1].tzname[0] != 0) {
@@ -2133,7 +2133,7 @@
 {
 	register int *p;
 	time_t t1, t, v;
-	int wday;					/* Note: wday can be uninitialized. */
+	int wday = wday; /* ok to be uninitialized, shutting up warning */
 
 	{
 		register const uint16_t *vp;

Modified: trunk/uClibc/libc/stdio/old_vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/old_vfprintf.c	2008-06-01 21:52:47 UTC (rev 22173)
+++ trunk/uClibc/libc/stdio/old_vfprintf.c	2008-06-01 22:11:07 UTC (rev 22174)
@@ -359,13 +359,13 @@
 		int i;
 	} intarg;
 	int i, cnt, dataargtype, len;
-	const void *argptr;			/* This does not need to be initialized. */
+	const void *argptr = argptr; /* ok to be initialized. */
 	register char *p;
 	const char *fmt0;
 	int preci, width;
 #define upcase i
 	int radix, dpoint /*, upcase*/;
-	char tmp[65];				/* TODO - determing needed size from headers */
+	char tmp[65];		/* TODO - determine needed size from headers */
 	char flag[sizeof(spec)];
 	__STDIO_AUTO_THREADLOCK_VAR;
 




More information about the uClibc-cvs mailing list