Skip to content

Commit

Permalink
Disable -Wunused-function for shared GC in gc/gc.h
Browse files Browse the repository at this point in the history
Shared GC might not use the private functions in gc/gc.h, so they will
show up as warnings for unused functions. This commit disables
-Wunused-function for these functions when building as shared GC.
  • Loading branch information
peterzhu2118 committed Oct 7, 2024
1 parent 9ee0e11 commit 216d087
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ void rb_ractor_finish_marking(void);
// -------------------Private section begin------------------------
// Functions in this section are private to the default GC and gc.c

#ifdef BUILDING_SHARED_GC
RBIMPL_WARNING_PUSH()
RBIMPL_WARNING_IGNORED(-Wunused-function)
#endif

/* RGENGC_CHECK_MODE
* 0: disable all assertions
* 1: enable assertions (to debug RGenGC)
Expand Down Expand Up @@ -180,6 +185,10 @@ type_sym(size_t type)
default: return SIZET2NUM(type); break;
}
}

#ifdef BUILDING_SHARED_GC
RBIMPL_WARNING_POP()
#endif
// -------------------Private section end------------------------

#endif

0 comments on commit 216d087

Please sign in to comment.