United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7171223 Building ExtensionSubtables.cpp should use -fno-strict-aliasing
JDK-7171223 : Building ExtensionSubtables.cpp should use -fno-strict-aliasing

Details
Type:
Bug
Submit Date:
2012-05-23
Status:
Resolved
Updated Date:
2012-06-12
Project Name:
JDK
Resolved Date:
2012-06-12
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
At present, the building of ExtensionSubtables.cpp produces a warning:

../../../src/share/native/sun/font/layout/ExtensionSubtables.cpp:57:31:
warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

due to this code:

// read a 32-bit value that might only be 16-bit-aligned in memory                                                              
#define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1)))

where code is a le_uint32.

This can be avoided by setting -fno-strict-aliasing, as done in this webrev:

                                    

Comments
EVALUATION

Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7171223
Changeset: http://hg.openjdk.java.net/jdk8/2d/jdk/rev/c892ca15ca52
Review thread: http://mail.openjdk.java.net/pipermail/2d-dev/2012-May/002517.html
                                     
2012-06-12



Hardware and Software, Engineered to Work Together