From 2fae10f887b48b809bac56e4ff8a5c3fd4525de3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 24 Feb 2018 16:45:33 -0500 Subject: 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. --- include/stdio.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') 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; -- cgit v1.2.1