Skip to content

Commit de10585

Browse files
committed
Don't expose printf if we don't have a stdout.
The Arty A7 bootloader uses some of the RTOS headers but does not define the UART in the normal way (and can't because it runs before the loader) and so this is broken.
1 parent 18de34c commit de10585

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sdk/include/stdio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static inline int fprintf(FILE *stream, const char *format, ...)
4848
return ret;
4949
}
5050

51+
#ifdef stdout
5152
static inline int printf(const char *format, ...)
5253
{
5354
va_list ap;
@@ -57,6 +58,7 @@ static inline int printf(const char *format, ...)
5758
va_end(ap);
5859
return ret;
5960
}
61+
#endif
6062

6163
int __cheri_libcall snprintf(char *str, size_t size, const char *format, ...);
6264
int __cheri_libcall vsnprintf(const char *str,

0 commit comments

Comments
 (0)