Skip to content

Commit

Permalink
Prevent use of non-static initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasakm committed Jul 29, 2023
1 parent 9f2c841 commit caa9470
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/frontend/c/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,16 +1910,18 @@ expression_bp(Parser *parser, int bp)
return left;
}

static Parameter memcpy_params[] = {
{ .name = STR("dest"), .type = &TYPE_VOID_PTR.base },
{ .name = STR("src"), .type = &TYPE_VOID_PTR.base },
{ .name = STR("size"), .type = &TYPE_INT },
};

static FunctionType memcpy_type = {
.base = { .kind = TY_FUNCTION },
.vararg = false,
.ret_type = &TYPE_VOID_PTR.base,
.param_cnt = 3,
.params = (Parameter[]) {
{ .name = STR("dest"), .type = &TYPE_VOID_PTR.base },
{ .name = STR("src"), .type = &TYPE_VOID_PTR.base },
{ .name = STR("size"), .type = &TYPE_INT },
},
.params = memcpy_params,
};

void
Expand Down

0 comments on commit caa9470

Please sign in to comment.