[njs] Fixed building by GCC with -O3.

Dmitry Volyntsev xeioex at nginx.com
Wed Nov 22 15:56:32 UTC 2017


details:   http://hg.nginx.org/njs/rev/22cc52416e84
branches:  
changeset: 433:22cc52416e84
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Nov 22 18:55:57 2017 +0300
description:
Fixed building by GCC with -O3.

diffstat:

 njs/njs_fs.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 5eb2620a9bec -r 22cc52416e84 njs/njs_fs.c
--- a/njs/njs_fs.c	Mon Nov 20 20:08:56 2017 +0300
+++ b/njs/njs_fs.c	Wed Nov 22 18:55:57 2017 +0300
@@ -566,6 +566,8 @@ static njs_ret_t njs_fs_write_file_inter
     }
 
     mode = NULL;
+    /* GCC complains about uninitialized flag.length. */
+    flag.length = 0;
     flag.start = NULL;
     encoding.length = 0;
     encoding.start = NULL;
@@ -753,6 +755,8 @@ njs_fs_write_file_sync_internal(njs_vm_t
     }
 
     mode = NULL;
+    /* GCC complains about uninitialized flag.length. */
+    flag.length = 0;
     flag.start = NULL;
     encoding.length = 0;
     encoding.start = NULL;


More information about the nginx-devel mailing list