Welcome! Log In Create A New Profile

Advanced

[njs] Fixed building by GCC 4.

September 13, 2016 09:54AM
details: http://hg.nginx.org/njs/rev/79e04e43f569
branches:
changeset: 170:79e04e43f569
user: Igor Sysoev <igor@sysoev.ru>
date: Tue Sep 13 16:53:24 2016 +0300
description:
Fixed building by GCC 4.

diffstat:

njs/njs_builtin.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r cb414901cccc -r 79e04e43f569 njs/njs_builtin.c
--- a/njs/njs_builtin.c Tue Sep 13 16:19:26 2016 +0300
+++ b/njs/njs_builtin.c Tue Sep 13 16:53:24 2016 +0300
@@ -55,26 +55,31 @@ njs_builtin_objects_create(njs_vm_t *vm)
};

static const njs_object_prototype_t prototype_values[] = {
- { .object.type = NJS_OBJECT },
- { .object.type = NJS_ARRAY },
+ /*
+ * GCC 4 complains about unitialized .shared field,
+ * if the .type field is initialized as .object.type.
+ */
+ { .object = { .type = NJS_OBJECT } },
+ { .object = { .type = NJS_ARRAY } },

/*
* The .object.type field must be initialzed after the .value field,
* otherwise SunC 5.9 treats the .value as .object.value or so.
*/
{ .object_value = { .value = njs_value(NJS_BOOLEAN, 0, 0.0),
- .object.type = NJS_OBJECT_BOOLEAN } },
+ .object = { .type = NJS_OBJECT_BOOLEAN } } },

{ .object_value = { .value = njs_value(NJS_NUMBER, 0, 0.0),
- .object.type = NJS_OBJECT_NUMBER } },
+ .object = { .type = NJS_OBJECT_NUMBER } } },

{ .object_value = { .value = njs_string(""),
- .object.type = NJS_OBJECT_STRING } },
+ .object = { .type = NJS_OBJECT_STRING } } },

- { .object.type = NJS_FUNCTION },
- { .object.type = NJS_REGEXP },
+ { .object = { .type = NJS_FUNCTION } },
+ { .object = { .type = NJS_REGEXP } },

- { .date = { .time = NJS_NAN, .object.type = NJS_DATE } },
+ { .date = { .time = NJS_NAN,
+ .object = { .type = NJS_DATE } } },
};

static const njs_object_init_t *constructor_init[] = {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed building by GCC 4.

Igor Sysoev 998 September 13, 2016 09:54AM



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

Online Users

Guests: 123
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