Skip to content

Commit 5055fc0

Browse files
committed
Avoid warning for pm_token_buffer_t initialization
* This was causing this error on macOS Mojave: src/prism.c:8216:48: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] pm_token_buffer_t token_buffer = { 0 }; ^
1 parent a010c3f commit 5055fc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/prism.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8247,7 +8247,7 @@ parser_lex(pm_parser_t *parser) {
82478247

82488248
// If we haven't found an escape yet, then this buffer will be
82498249
// unallocated since we can refer directly to the source string.
8250-
pm_token_buffer_t token_buffer = { 0 };
8250+
pm_token_buffer_t token_buffer = { { 0 }, 0 };
82518251

82528252
while (breakpoint != NULL) {
82538253
// If we hit a null byte, skip directly past it.
@@ -8423,7 +8423,7 @@ parser_lex(pm_parser_t *parser) {
84238423
// characters.
84248424
const uint8_t *breakpoints = lex_mode->as.regexp.breakpoints;
84258425
const uint8_t *breakpoint = pm_strpbrk(parser, parser->current.end, breakpoints, parser->end - parser->current.end);
8426-
pm_token_buffer_t token_buffer = { 0 };
8426+
pm_token_buffer_t token_buffer = { { 0 }, 0 };
84278427

84288428
while (breakpoint != NULL) {
84298429
// If we hit a null byte, skip directly past it.
@@ -8612,7 +8612,7 @@ parser_lex(pm_parser_t *parser) {
86128612

86138613
// If we haven't found an escape yet, then this buffer will be
86148614
// unallocated since we can refer directly to the source string.
8615-
pm_token_buffer_t token_buffer = { 0 };
8615+
pm_token_buffer_t token_buffer = { { 0 }, 0 };
86168616

86178617
while (breakpoint != NULL) {
86188618
// If we hit the incrementor, then we'll increment then nesting and
@@ -8873,7 +8873,7 @@ parser_lex(pm_parser_t *parser) {
88738873
}
88748874

88758875
const uint8_t *breakpoint = pm_strpbrk(parser, parser->current.end, breakpoints, parser->end - parser->current.end);
8876-
pm_token_buffer_t token_buffer = { 0 };
8876+
pm_token_buffer_t token_buffer = { { 0 }, 0 };
88778877
bool was_escaped_newline = false;
88788878

88798879
while (breakpoint != NULL) {

0 commit comments

Comments
 (0)