On Sat, 02 Jun 2012 09:10:06 -0400 Ernie Wright <ern...@comcast.net> wrote: > On 6/2/2012 6:16 AM, Chris Vine wrote: > > > You are probably also interested in the strict aliasing rule, [...] > > This is an alarmingly often overlooked rule. > > In part because it wasn't in the standard prior to C99, which isn't > supported to the degree C90 is.
It was in C89 - ยง6.3: "An object shall have its stored value accessed only by an lvalue that has one of the following types: * the declared type of the object, * a qualified version of the declared type of the object, * a type that is the signed or unsigned type corresponding to the declared type of the object, * a type that is the signed or unsigned type corresponding to a qualified version of the declared type of the object, * an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union), or * a character type." It is the fifth bullet point which permits your usage. Not many 1990-vintage compilers used strict aliasing for optimization, but most (all?) now do with a sufficiently high optimizing level. Chris _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list