From 68ff6f8be54f82c170ad7a1526891c63d43ac951 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Sun, 1 Aug 2021 11:09:47 -0700 Subject: [PATCH] xmlconfig: Use static inline for regex fallback to prevent -O0 issues A non-static inline function body is only actually emitted by GCC during optimization passes, so running -O0 ends up never emitting the body, producing linker errors. Reviewed-by: Emil Velikov Reviewed-by: Charmaine Lee Reviewed-by: Neha Bhende Part-of: --- src/util/xmlconfig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c index 1f1ec14..8766bb0 100644 --- a/src/util/xmlconfig.c +++ b/src/util/xmlconfig.c @@ -48,9 +48,9 @@ typedef int regex_t; #define REG_EXTENDED 0 #define REG_NOSUB 0 #define REG_NOMATCH 1 -inline int regcomp(regex_t *r, const char *s, int f) { return 0; } -inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; } -inline void regfree(regex_t* r) {} +static inline int regcomp(regex_t *r, const char *s, int f) { return 0; } +static inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; } +static inline void regfree(regex_t* r) {} #else #include #endif -- 2.7.4