Skip to content

Warning in C extension #954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/rbs_extension/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ VALUE RBS_MethodType;

VALUE RBS_ParsingError;

void rbs__init_constants() {
void rbs__init_constants(void) {
ID id_RBS = rb_intern_const("RBS");

RBS = rb_const_get(rb_cObject, id_RBS);
Expand Down
2 changes: 1 addition & 1 deletion ext/rbs_extension/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'mkmf'
$INCFLAGS << " -I$(top_srcdir)" if $extmk
$CFLAGS += " -std=c99 "
$CFLAGS += " -std=c99 -Wold-style-definition"
create_makefile 'rbs_extension'
2 changes: 1 addition & 1 deletion ext/rbs_extension/location.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ VALUE rbs_location_pp(VALUE buffer, const position *start_pos, const position *e
return rbs_new_location(buffer, rg);
}

void rbs__init_location() {
void rbs__init_location(void) {
RBS_Location = rb_define_class_under(RBS, "Location", rb_cObject);
rb_define_alloc_func(RBS_Location, location_s_allocate);
rb_define_private_method(RBS_Location, "initialize", location_initialize, 3);
Expand Down
6 changes: 3 additions & 3 deletions ext/rbs_extension/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static VALUE string_of_loc(parserstate *state, position start, position end) {
/**
* Raises RuntimeError with "Unexpected error " messsage.
* */
static NORETURN(void) rbs_abort() {
static NORETURN(void) rbs_abort(void) {
rb_raise(
rb_eRuntimeError,
"Unexpected error"
Expand Down Expand Up @@ -1065,7 +1065,7 @@ VALUE parse_type_params(parserstate *state, range *rg, bool module_type_params)
}

param_range.end = state->current_token.range.end;

VALUE location = rbs_new_location(state->buffer, param_range);
rbs_loc *loc = rbs_check_location(location);
rbs_loc_add_required_child(loc, rb_intern("name"), name_range);
Expand Down Expand Up @@ -2496,7 +2496,7 @@ rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE line, VALUE column)
return signature;
}

void rbs__init_parser() {
void rbs__init_parser(void) {
RBS_Parser = rb_define_class_under(RBS, "Parser", rb_cObject);
rb_define_singleton_method(RBS_Parser, "_parse_type", rbsparser_parse_type, 4);
rb_define_singleton_method(RBS_Parser, "_parse_method_type", rbsparser_parse_method_type, 4);
Expand Down
4 changes: 2 additions & 2 deletions ext/rbs_extension/parserstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define RESET_TABLE_P(table) (table->size == 0)

id_table *alloc_empty_table() {
id_table *alloc_empty_table(void) {
id_table *table = malloc(sizeof(id_table));
table->size = 10;
table->count = 0;
Expand All @@ -11,7 +11,7 @@ id_table *alloc_empty_table() {
return table;
}

id_table *alloc_reset_table() {
id_table *alloc_reset_table(void) {
id_table *table = malloc(sizeof(id_table));
table->size = 0;

Expand Down