Skip to content

Commit

Permalink
util: fix build with CFLAGS="-g"
Browse files Browse the repository at this point in the history
The build process fails with debug symbols enabled. It appears that
`CFLAGS=-g` influences the compiler's inlining decisions, leading to a
situation where the `is_str_empty` function is not inlined, and the
linker is searching for an out-of-line definition that isn’t present.
The most straightforward fix is to declare this function
`static inline`.

Signed-off-by: Wolfgang Frisch <[email protected]>
  • Loading branch information
wfrisch committed Sep 4, 2024
1 parent 75e767d commit 865f393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ char* trim_space(char *str);
int get_abbreviated(uint64_t num, int max_digs, char *res);
int contains(const char *prfx, const char *str);

inline int is_str_empty(char *str)
static inline int is_str_empty(char *str)
{
if (str && str[0] == '\0')
return 1;
Expand Down

0 comments on commit 865f393

Please sign in to comment.