]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug: also declare strlen() in __ABORT_NOW()
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Jun 2024 06:02:09 +0000 (08:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 26 Jun 2024 06:04:40 +0000 (08:04 +0200)
Previous commit 8f204fa8ae ("MINOR: debug: print gdb hints when crashing")
broken on the CI where strlen() isn't known. Let's forward-declare it in
the __ABORT_NOW() functions, just like write(). No backport is needed.

include/haproxy/bug.h

index f43dbad2b4f2e8f8ec5c2d6c7e3a18dd291bcfb0..8ca6415a1b1ed84f849fe1f0b07dd436764875d5 100644 (file)
@@ -124,6 +124,7 @@ static __attribute__((noinline,noreturn,unused)) void abort_with_line(uint line)
 
 #define __ABORT_NOW(file, line, ...) do {                              \
                extern ssize_t write(int, const void *, size_t);        \
+               extern size_t strlen(const char *s);                    \
                const char *msg;                                        \
                if (sizeof("" __VA_ARGS__) > 1)                         \
                        complain(NULL, "\nABORT at " file ":" #line ": " __VA_ARGS__ "\n", 1); \
@@ -141,6 +142,7 @@ static __attribute__((noinline,noreturn,unused)) void abort_with_line(uint line)
  */
 #define __ABORT_NOW(file, line, ...) do {                              \
                extern ssize_t write(int, const void *, size_t);        \
+               extern size_t strlen(const char *s);                    \
                const char *msg;                                        \
                if (sizeof("" __VA_ARGS__) > 1)                         \
                        complain(NULL, "\nABORT at " file ":" #line ": " __VA_ARGS__ "\n", 1); \