about summary refs log tree commit diff
path: root/include/alltypes.h.in
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-03-12 15:24:00 -0400
committerRich Felker <dalias@aerifal.cx>2019-03-12 15:24:00 -0400
commitf368d9fd26ae002fe2fce20add4cb2b806f48972 (patch)
treefc3f6dff04f55277566a5a69c1f2acfb587855b3 /include/alltypes.h.in
parent50cd02386b152bb39a1a9d1edba3fdcda7771a4c (diff)
downloadmusl-f368d9fd26ae002fe2fce20add4cb2b806f48972.tar.gz
musl-f368d9fd26ae002fe2fce20add4cb2b806f48972.tar.xz
musl-f368d9fd26ae002fe2fce20add4cb2b806f48972.zip
make FILE a complete type for pre-C11 standard profiles
C11 removed the requirement that FILE be a complete type, which was
deemed erroneous, as part of the changes introduced by N1439 regarding
completeness of types (see footnote 6 for specific mention of FILE).
however the current version of POSIX is still based on C99 and
incorporates the old requirement that FILE be a complete type.

expose an arbitrary, useless complete type definition because the
actual object used to represent FILE streams cannot be public/ABI.

thanks to commit 13d1afa46f8098df290008c681816c9eb89ffbdb, we now have
a framework for suppressing the public complete-type definition of FILE
when stdio.h is included internally, so that a different internal
definition can be provided. this is perfectly well-defined, since the
same struct tag can refer to different types in different translation
units. it would be a problem if the implementation were accessing the
application's FILE objects or vice versa, but either would be
undefined behavior.
Diffstat (limited to 'include/alltypes.h.in')
-rw-r--r--include/alltypes.h.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/alltypes.h.in b/include/alltypes.h.in
index 622ca01d..4cc879b1 100644
--- a/include/alltypes.h.in
+++ b/include/alltypes.h.in
@@ -57,6 +57,7 @@ TYPEDEF struct { unsigned __attr; } pthread_condattr_t;
 TYPEDEF struct { unsigned __attr; } pthread_barrierattr_t;
 TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
 
+STRUCT _IO_FILE { char __x; };
 TYPEDEF struct _IO_FILE FILE;
 
 TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;