path: root/include
diff options
authorRich Felker <>2018-02-24 16:45:33 -0500
committerRich Felker <>2018-02-24 16:45:33 -0500
commit2fae10f887b48b809bac56e4ff8a5c3fd4525de3 (patch)
treef9699222bbdd13e75f6b5ecda6d11cbc54a3d9d5 /include
parent455bd824457b3e6cc3998817aac4e500b027cc50 (diff)
fix aliasing violations in fgetpos/fsetpos
add a member of appropriate type to the fpos_t union so that accesses are well-defined. use long long instead of off_t since off_t is not always exposed in stdio.h and there's no namespace-clean alias for it. access is still performed using pointer casts rather than by naming the union member as a matter of style; to the extent possible, the naming of fields in opaque types defined in the public headers is not treated as an API contract with the implementation. access via the pointer cast is valid as long as the union has a member of matching type.
Diffstat (limited to 'include')
1 files changed, 1 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 7c4f9ee4..afadd912 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -49,6 +49,7 @@ extern "C" {
typedef union _G_fpos64_t {
char __opaque[16];
+ long long __lldata;
double __align;
} fpos_t;