[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] [RFC PATCH] Fix strict-aliasing warning
From: |
Gilles Espinasse |
Subject: |
[ft-devel] [RFC PATCH] Fix strict-aliasing warning |
Date: |
Sun, 1 Jul 2012 12:23:00 +0200 |
Building with gcc-4.4.5 and -Os give this warning
/usr/src/freetype-2.4.10/src/base/ftglyph.c: In function 'FT_Glyph_To_Bitmap':
/usr/src/freetype-2.4.10/src/base/ftglyph.c:296: warning: dereferencing pointer
'bitmap.17' does break strict-aliasing rules
/usr/src/freetype-2.4.10/src/base/ftglyph.c:288: warning: dereferencing pointer
'bitmap.17' does break strict-aliasing rules
/usr/src/freetype-2.4.10/src/base/ftglyph.c:550: note: initialized from here
Call ft_new_glyph with a real glyph, not casting bitmap and set bitmap only
after that call.
Check that change, I am far from a C guru.
Signed-off-by: Gilles Espinasse <address@hidden>
---
src/base/ftglyph.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 591b57a..8db4bc3 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -547,11 +547,12 @@
dummy.format = clazz->glyph_format;
/* create result bitmap glyph */
- error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET,
- (FT_Glyph*)(void*)&bitmap );
+ error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &glyph );
if ( error )
goto Exit;
+ bitmap = (FT_BitmapGlyph)glyph;
+
#if 1
/* if `origin' is set, translate the glyph image */
if ( origin )
--
1.7.2.5
- [ft-devel] [RFC PATCH] Fix strict-aliasing warning,
Gilles Espinasse <=