Skip to content

Commit

Permalink
Workaround 'r_debug::r_version is never used' cppcheck FP in dyn_load.c
Browse files Browse the repository at this point in the history
(fix of commit edf607b)

Issue #627 (bdwgc).

* dyn_load.c [HOST_ANDROID && !GC_DONT_DEFINE_LINK_MAP
&& !(__ANDROID_API__>=21)] (r_debug): Comment out unused `r_brk`,
`r_state`, `r_ldbase` fields.
* dyn_load.c [(!NETBSD || !RTLD_DI_LINKMAP) && CPPCHECK && HOST_ANDROID
&& !GC_DONT_DEFINE_LINK_MAP && !(__ANDROID_API__>=21)]
(GC_FirstDLOpenedLinkMap): Call `GC_noop1(rd->r_version)`.
  • Loading branch information
ivmai committed Nov 1, 2024
1 parent 462a6cd commit a0b7a8d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dyn_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ struct link_map {
struct r_debug {
int32_t r_version;
struct link_map *r_map;
void (*r_brk)(void);
int32_t r_state;
uintptr_t r_ldbase;
/* void (*r_brk)(void); */
/* int32_t r_state; */
/* uintptr_t r_ldbase; */
};
# endif
# else
Expand Down Expand Up @@ -884,6 +884,10 @@ GC_FirstDLOpenedLinkMap(void)
if (rd != NULL) {
const struct link_map *lm = rd->r_map;

# if defined(CPPCHECK) && defined(HOST_ANDROID) \
&& !defined(GC_DONT_DEFINE_LINK_MAP) && !(__ANDROID_API__ >= 21)
GC_noop1((word)rd->r_version);
# endif
if (lm != NULL)
cachedResult = lm->l_next; /* might be NULL */
}
Expand Down

0 comments on commit a0b7a8d

Please sign in to comment.