Closed salix5 closed 7 months ago
A pointer to a struct can be cast to a pointer to its first member and vice versa. This do not violate strict aliasing rule https://stackoverflow.com/questions/50383187/is-it-a-strict-aliasing-violation-to-alias-a-struct-as-its-first-member https://stackoverflow.com/questions/60536422/pointer-aliasing-between-struct-and-first-member-of-struct
@mercury233 struct sqlite3_vfs_t user-defined type
https://github.com/Fluorohydride/ygopro/blob/4c0ca0f1b9b8c9b0389ca43f67bc8070801509fd/gframe/spmemvfs/spmemvfs.c#L259 There is only 1
sqlite3_vfs_t
object, g_spmemvfs, so there is only 1sqlite3_vfs
object, g_spmemvfs.base.The pointer cast breaks strict aliasing rule, and it is unnecessary.