Skip to content

Commit

Permalink
Make standard file streams nonnull in minimal stdio
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterymath committed May 22, 2024
1 parent 2e9f558 commit 7fd1360
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mos-platform/common/c/stdio-minimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#include <stdint.h>
#include <string.h>

__attribute__((weak)) FILE *stdin;
__attribute__((weak)) FILE *stdout;
__attribute__((weak)) FILE *stderr;
// These need to be non-null, but their contents otherwise doesn't matter.
__attribute__((weak)) FILE *stdin = (FILE *)1;
__attribute__((weak)) FILE *stdout = (FILE *)1;
__attribute__((weak)) FILE *stderr = (FILE *)1;

// Character input/output functions

Expand Down

0 comments on commit 7fd1360

Please sign in to comment.