Skip to content

Commit

Permalink
Suppress unused function warnings when included
Browse files Browse the repository at this point in the history
This allows gc.h to be included into compile modules other then concrete
gc implementations without warning about some unused functions.

I chose this approach because I want warnings suppressed only for these
specific functions
  • Loading branch information
eightbitraptor committed Oct 9, 2024
1 parent f7fdf6c commit cb3965a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ hash_replace_ref_value(st_data_t *key, st_data_t *value, st_data_t argp, int exi
return ST_CONTINUE;
}

RBIMPL_ATTR_MAYBE_UNUSED()
static void
gc_ref_update_table_values_only(st_table *tbl)
{
Expand All @@ -97,6 +98,7 @@ gc_ref_update_table_values_only(st_table *tbl)
}
}

RBIMPL_ATTR_MAYBE_UNUSED()
static int
gc_mark_tbl_no_pin_i(st_data_t key, st_data_t value, st_data_t data)
{
Expand Down Expand Up @@ -133,6 +135,7 @@ hash_replace_ref(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
return ST_CONTINUE;
}

RBIMPL_ATTR_MAYBE_UNUSED()
static void
gc_update_table_refs(st_table *tbl)
{
Expand All @@ -149,6 +152,7 @@ xmalloc2_size(const size_t count, const size_t elsize)
return rb_size_mul_or_raise(count, elsize, rb_eArgError);
}

RBIMPL_ATTR_MAYBE_UNUSED()
static VALUE
type_sym(size_t type)
{
Expand Down

0 comments on commit cb3965a

Please sign in to comment.