Welcome! Log In Create A New Profile

Advanced

[njs] XML: fixed compilation with certain GCC versions.

Dmitry Volyntsev
October 18, 2023 09:52PM
details: https://hg.nginx.org/njs/rev/3a7526c8694c
branches:
changeset: 2222:3a7526c8694c
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Wed Oct 18 18:36:00 2023 -0700
description:
XML: fixed compilation with certain GCC versions.

external/njs_xml_module.c:541:16: error: 'name.length' may be used
uninitialized [-Werror=maybe-uninitialized]
541 | if (name.length != njs_strlen(node->name).

diffstat:

external/njs_xml_module.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r c0ff44d66ffb -r 3a7526c8694c external/njs_xml_module.c
--- a/external/njs_xml_module.c Tue Oct 17 17:51:39 2023 -0700
+++ b/external/njs_xml_module.c Wed Oct 18 18:36:00 2023 -0700
@@ -527,6 +527,11 @@ njs_xml_doc_ext_root(njs_vm_t *vm, njs_o
njs_value_undefined_set(retval);
return NJS_DECLINED;
}
+
+ } else {
+ /* To suppress warning. */
+ name.length = 0;
+ name.start = NULL;
}

for (node = xmlDocGetRootElement(tree->doc);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] XML: fixed compilation with certain GCC versions.

Dmitry Volyntsev 359 October 18, 2023 09:52PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 108
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready