[njs] Suppressed spurious compilation warning with gcc-7 and older.

Dmitry Volyntsev xeioex at nginx.com
Mon May 24 12:35:27 UTC 2021


details:   https://hg.nginx.org/njs/rev/55d405b30979
branches:  
changeset: 1640:55d405b30979
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon May 24 12:33:36 2021 +0000
description:
Suppressed spurious compilation warning with gcc-7 and older.

src/njs_regexp.c:1335:19: error: ‘pos’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
    pos = njs_string_offset(s.start, s.start + s.size, pos) - s.start;

diffstat:

 src/njs_regexp.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r f1e8e753417d -r 55d405b30979 src/njs_regexp.c
--- a/src/njs_regexp.c	Mon May 24 10:51:48 2021 +0000
+++ b/src/njs_regexp.c	Mon May 24 12:33:36 2021 +0000
@@ -1301,6 +1301,7 @@ njs_regexp_prototype_symbol_replace(njs_
     }
 
     i = 0;
+    pos = 0;
     next_pos = 0;
 
     while (i < results.items) {


More information about the nginx-devel mailing list