Skip to content

Commit

Permalink
Extension use
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Dec 19, 2023
1 parent 13205f1 commit d86d095
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,16 @@ struct JSString {
#ifdef DUMP_LEAKS
struct list_head link; /* string list */
#endif
// Can't use union of flexible array members in Wpedantic mode, so ignore warning
#ifdef STRICT_R_HEADERS
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
union {
__extension__ uint8_t str8[0]; /* 8 bit strings will get an extra null terminator */
__extension__ uint16_t str16[0];
} u;
#else
union {
uint8_t str8[0]; /* 8 bit strings will get an extra null terminator */
uint16_t str16[0];
} u;
#ifdef STRICT_R_HEADERS
#pragma GCC diagnostic pop
#endif
};

Expand Down

0 comments on commit d86d095

Please sign in to comment.