diff options
-rw-r--r-- | src/stdio/fopen.c | 2 | ||||
-rw-r--r-- | src/stdio/freopen.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index 4c9eabd7..dfb4f27c 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -37,6 +37,8 @@ FILE * fopen(const char * restrict filename, const char * restrict mode) return freopen(filename, mode, f); } +CHECK_2(FILE *, NULL, fopen, const char * restrict, const char * restrict) + /*** opens a file stream associated with the file ARGUMENT(filename). diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c index 050e556b..0fd0a2f8 100644 --- a/src/stdio/freopen.c +++ b/src/stdio/freopen.c @@ -23,6 +23,7 @@ /** reopen a file stream with a new file **/ +GCC_SSE_HACK FILE * freopen(const char * restrict filename, const char * restrict mode, FILE * restrict stream) { struct { @@ -69,6 +70,7 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE } if (openmode == -1) { + __undefined("\"%s\" is not a valid mode for fopen() or freopen()", mode); #ifdef EINVAL errno = EINVAL; #endif @@ -102,6 +104,8 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE return stream; } +CHECK_3(FILE *, NULL, freopen, const char * restrict, const char * restrict, FILE * restrict) + /*** changes the file associated with ARGUMENT(stream) to ARGUMENT(filename). The meaning of ARGUMENT(mode) is the same as with |