On Saturday 19 May 2007 12:14:06 Ismail Dönmez wrote:
> On Wednesday 16 May 2007 18:56:03 you wrote:
> > > Here is the last piece of strict aliasing warnings, it would rock if
> > > those could be fixed so -O2 can be safely enabled.  [...]
> >
> > I think I've now removed all such warnings from the CVS.  Please test.
>
> Very nice! Just one aliasing warning with gcc 4.2.0:
>
> In file included from /packages/freetype2/src/sfnt/sfnt.c:24:
> /packages/freetype2/src/sfnt/ttmtx.c: In function 'tt_face_get_metrics':
> /packages/freetype2/src/sfnt/ttmtx.c:362: warning: dereferencing
> type-punned pointer will break strict-aliasing rules

Attached patch should fix it.

Regards,
ismail

-- 
Perfect is the enemy of good
Index: src/sfnt/ttmtx.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/sfnt/ttmtx.c,v
retrieving revision 1.21
diff -u -r1.21 ttmtx.c
--- src/sfnt/ttmtx.c	16 May 2007 15:19:42 -0000	1.21
+++ src/sfnt/ttmtx.c	19 May 2007 14:20:31 -0000
@@ -359,7 +359,9 @@
 
     if ( vertical )
     {
-      header     = (TT_HoriHeader*)&face->vertical;
+      void* fvertical = &face->vertical;
+
+      header     = (TT_HoriHeader*)fvertical;
       table_pos  = face->vert_metrics_offset;
       table_size = face->vert_metrics_size;
     }

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to