[PATCH] pbl: console: fix undefined reference to vprintf()
Sascha Hauer
s.hauer at pengutronix.de
Wed Mar 4 02:49:04 PST 2026
panic() now uses vprintf() which is not available without
CONFIG_PBL_CONSOLE. Move the declaration to the right ifdeffery
which already handles that case.
Fixes: 33e3bc4782 ("pbl: fix panic() message printing")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/stdio.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/stdio.h b/include/stdio.h
index 945ec46926..4c0dff0c00 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -12,10 +12,8 @@
/* stdin */
int tstc(void);
int getchar(void);
-int vprintf(const char *fmt, va_list args);
#else
static inline int tstc(void) { return 0; }
-static inline int vprintf(const char *fmt, va_list args) { return 0; }
static inline int getchar(void) { return -EINVAL; }
#endif
@@ -23,11 +21,13 @@ int readline(const char *prompt, char *buf, int len);
#if (IN_PROPER && !defined(CONFIG_CONSOLE_NONE)) || \
(IN_PBL && defined(CONFIG_PBL_CONSOLE))
+int vprintf(const char *fmt, va_list args);
static inline int puts(const char *s) { return console_puts(CONSOLE_STDOUT, s); }
static inline void putchar(char c) { console_putc(CONSOLE_STDOUT, c); }
#else
static inline int puts(const char *s) { return 0; }
static inline void putchar(char c) {}
+static inline int vprintf(const char *fmt, va_list args) { return 0; }
#endif
int readline(const char *prompt, char *buf, int len);
--
2.47.3
More information about the barebox
mailing list