super1.c:1146: warning: 'offset' might be used uninitialized in this function

Started by Krzysztof Oledzki on Feb 13, 2007

open the first message on its own page

Message details and related content
Hello,

I'm unable to compile mdadm-2.6 with gcc-3.4.6 and
make all mdadm.static CXFLAGS="-s -Os":

super1.c: In function `add_internal_bitmap1':
super1.c:1146: warning: 'offset' might be used uninitialized in this function
make: *** [super1.o] Error 1

How about attached patch?

diff -Nur mdadm-2.6-orig/super1.c mdadm-2.6/super1.c
--- mdadm-2.6-orig/super1.c	2006-12-14 07:33:13.000000000 +0100
+++ mdadm-2.6/super1.c	2007-02-13 02:37:01.000000000 +0100
@@ -1203,6 +1203,9 @@
 			}
 		}
 		break;
+
+	default:
+		return 0;
 	}

 	if (chunk == UnSet && room > 128*2)
Best regards,

				Krzysztof Olędzki
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help