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

- From: Krzysztof Oledzki \<hidden\>
- Date: 2007-02-13 01:39:17 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2007/02/6599214
- Thread: https://ratatoskr.run/linux-raid/2007/02/6599214/t.md

```text
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
```

## Attachments

- [mdadm-2.6-offset-uninitialized.patch](https://ratatoskr.run/linux-raid/2007/02/6599214/attachment/0) (text/plain, 302 bytes)
