]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix some unintialized variables with -O3 15/1015/1
authorLionel Sambuc <lionel@minix3.org>
Tue, 8 Oct 2013 09:45:49 +0000 (11:45 +0200)
committerLionel Sambuc <lionel@minix3.org>
Tue, 8 Oct 2013 09:45:49 +0000 (11:45 +0200)
Change-Id: I7c41b355a503f97501e9ecb768c77a80d1d7ef0c

external/bsd/atf/dist/atf-c/detail/fs.c
external/bsd/atf/dist/atf-c/detail/process.c
external/bsd/kyua-testers/dist/atf_list.c
external/bsd/kyua-testers/dist/fs.c
usr.bin/make/suff.c

index 22cbca439b36c7c0fee5fc6224808e5935b97824..2b0c40dd952f1baf67094961263abf92f10b9d1f 100644 (file)
@@ -797,7 +797,7 @@ atf_error_t
 atf_fs_mkdtemp(atf_fs_path_t *p)
 {
     atf_error_t err;
-    char *buf;
+    char *buf = NULL;
 
     if (!check_umask(S_IRWXU, S_IRWXU)) {
         err = invalid_umask_error(p, atf_fs_stat_dir_type, current_umask());
@@ -825,7 +825,7 @@ atf_error_t
 atf_fs_mkstemp(atf_fs_path_t *p, int *fdout)
 {
     atf_error_t err;
-    char *buf;
+    char *buf = NULL;
     int fd;
 
     if (!check_umask(S_IRWXU, S_IRWXU)) {
index bc36b570e7d3f037d37a01ff1ae1e9b35ccabb75..daa12c43b9c45668ffcd825062416464a1c8a116 100644 (file)
@@ -621,7 +621,7 @@ atf_process_exec_array(atf_process_status_t *s,
                        void (*prehook)(void))
 {
     atf_error_t err;
-    atf_process_child_t c;
+    atf_process_child_t c = { .m_pid = 0, .m_stdout = 1, .m_stderr = 2 };
     struct exec_args ea = { prog, argv, prehook };
 
     PRE(outsb == NULL ||
index b6d46a8c98c5e9af002dd1689081ed035ef022ef..becc452e9d2947a132f68a5d556058b34ca1e81a 100644 (file)
@@ -256,7 +256,7 @@ parse_test_case(FILE* input, FILE* output, char* name)
     while (!kyua_error_is_set(error) &&
            fgets_no_newline(line, sizeof(line), input) != NULL &&
            strcmp(line, "") != 0) {
-        char* key; char* value;
+        char* key = NULL; char* value = NULL;
         error = parse_property(line, &key, &value);
         if (!kyua_error_is_set(error)) {
             const char* out_key = rewrite_property(key);
@@ -300,7 +300,7 @@ parse_tests(FILE* input, FILE* output)
     kyua_error_t error;
 
     do {
-        char* key; char* value;
+        char* key = NULL; char* value = NULL;
         error = parse_property(line, &key, &value);
         if (kyua_error_is_set(error))
             break;
index 6294828fcb6c753a75f7fbe9a3c25195b488d85b..a79b0bd753c2d30b3ca1e0506013d852e3e4e5a0 100644 (file)
@@ -518,7 +518,7 @@ kyua_fs_make_absolute(const char* original, char** const output)
         strcpy(*output, original);
         return kyua_error_ok();
     } else {
-        char* current_path;
+        char* current_path= NULL;
         kyua_error_t error;
 
         error = kyua_fs_current_path(&current_path);
index 6abdeb0459e51b73606aedbf0f0b1d2708bd880d..991c246c73ac247f2bdefbbfe418a4997a0a3f55 100644 (file)
@@ -684,8 +684,8 @@ GNode *
 Suff_AddTransform(char *line)
 {
     GNode         *gn;         /* GNode of transformation rule */
-    Suff          *s,          /* source suffix */
-                  *t;          /* target suffix */
+    Suff          *s = NULL,   /* source suffix */
+                  *t = NULL;   /* target suffix */
     LstNode      ln;           /* Node for existing transformation */
 
     ln = Lst_Find(transforms, line, SuffGNHasNameP);