[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] strict aliasing
From: |
Ken Turkowski |
Subject: |
[ft-devel] strict aliasing |
Date: |
Tue, 10 Nov 2015 23:35:45 +0000 |
Compilers are beginning to embrace more aggressive optimization techniques. One
of these directions is that of strict aliasing. We have experienced crashes on
some ARM embedded devices in some code that was flagged with the “strict
aliasing” warning. We have been going through our code, changing casts to
unions in appropriate ways, and have sidestepped the crashes.
However, Freetype is a bit of a problem, since it is open source.
Are you planning to make a pass over the Freetype code base to eradicate these
strict aliases?
The following warnings were produced by the Android NDK R10e compiler, which is
currently the chattiest:
/freetype-2.6/include/config/ftmodule.h:14:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:15:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:16:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:17:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:18:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:19:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:20:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:21:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:25:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:27:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:28:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:29:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/include/config/ftmodule.h:30:1: warning: dereferencing
type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/autofit/afcjk.c:161:7: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/autofit/aflatin.c:155:7: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:264:3: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:321:5: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:388:5: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:447:3: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:504:5: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cache/ftcbasic.c:573:5: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/cff/cf2font.c:474:31: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/sfnt/ttcmap.c:3534:13: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/sfnt/ttcmap.c:3539:13: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
/freetype-2.6/src/sfnt/ttcmap.c:3542:15: warning: dereferencing type-punned
pointer might break strict-aliasing rules [-Wstrict-aliasing]
For more helpful information, do “man gcc” and search for ‘-fstrict-aliasing:.
Ken Turkowski
Marvell Semiconductor
- [ft-devel] strict aliasing,
Ken Turkowski <=