Fix gcc uninitialized variable warnings
[zfs.git] / lib / libuutil / uu_misc.c
index 3d5b40c..578bf32 100644 (file)
@@ -209,7 +209,11 @@ uu_panic(const char *format, ...)
 int
 assfail(const char *astring, const char *file, int line)
 {
+#if defined(__STDC__) && __STDC_VERSION__ - 0 >= 199901L
+       __assert_c99(astring, file, line, "unknown func");
+#else
        __assert(astring, file, line);
+#endif
        /*NOTREACHED*/
        return (0);
 }
@@ -245,7 +249,13 @@ uu_release_child(void)
        uu_release();
 }
 
+#ifdef __GNUC__
+static void
+uu_init(void) __attribute__((constructor));
+#else
 #pragma init(uu_init)
+#endif
+
 static void
 uu_init(void)
 {