diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-02-24 16:45:33 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-02-24 16:45:33 -0500 |
commit | 2fae10f887b48b809bac56e4ff8a5c3fd4525de3 (patch) | |
tree | f9699222bbdd13e75f6b5ecda6d11cbc54a3d9d5 /include | |
parent | 455bd824457b3e6cc3998817aac4e500b027cc50 (diff) | |
download | musl-2fae10f887b48b809bac56e4ff8a5c3fd4525de3.tar.gz musl-2fae10f887b48b809bac56e4ff8a5c3fd4525de3.tar.bz2 musl-2fae10f887b48b809bac56e4ff8a5c3fd4525de3.tar.xz musl-2fae10f887b48b809bac56e4ff8a5c3fd4525de3.zip |
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')
-rw-r--r-- | include/stdio.h | 1 |
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; |