Bug #60247 Gentoo QA Warnings in dev-db/mysql-workbench-5.2.31: strict-aliasing breakages,
Submitted: 25 Feb 2011 6:56 Modified: 8 May 2011 17:37
Reporter: Dan Wallis Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.31 OS:Any (Gentoo x86)
Assigned to: CPU Architecture:Any

[25 Feb 2011 6:56] Dan Wallis
Description:
When trying to install the dev-db/mysql-workbench-5.2.31 package on my Gentoo system, I receive the following notices:

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * python_grtdict.cpp:379: warning: dereferencing type-punned pointer will break strict-aliasing rules
 * python_grtlist.cpp:459: warning: dereferencing type-punned pointer will break strict-aliasing rules
 * python_grtobject.cpp:550: warning: dereferencing type-punned pointer will break strict-aliasing rules
 * python_grtobject.cpp:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
 * python_module.cpp:409: warning: dereferencing type-punned pointer will break strict-aliasing rules
 * python_module.cpp:422: warning: dereferencing type-punned pointer will break strict-aliasing rules

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * python_grtdict.cpp:379: warning: dereferencing pointer 'PyGRTDictObjectType.336' does break strict-aliasing rules
 * python_grtdict.cpp:379: warning: dereferencing pointer 'PyGRTDictObjectType.336' does break strict-aliasing rules
 * python_grtlist.cpp:459: warning: dereferencing pointer 'PyGRTListObjectType.353' does break strict-aliasing rules
 * python_grtlist.cpp:459: warning: dereferencing pointer 'PyGRTListObjectType.353' does break strict-aliasing rules
 * python_grtobject.cpp:550: warning: dereferencing pointer 'PyGRTObjectObjectType.354' does break strict-aliasing rules
 * python_grtobject.cpp:550: warning: dereferencing pointer 'PyGRTObjectObjectType.354' does break strict-aliasing rules
 * python_grtobject.cpp:562: warning: dereferencing pointer 'PyGRTMethodObjectType.356' does break strict-aliasing rules
 * python_grtobject.cpp:562: warning: dereferencing pointer 'PyGRTMethodObjectType.356' does break strict-aliasing rules
 * python_module.cpp:409: warning: dereferencing pointer 'PyGRTModuleObjectType.325' does break strict-aliasing rules
 * python_module.cpp:409: warning: dereferencing pointer 'PyGRTModuleObjectType.325' does break strict-aliasing rules
 * python_module.cpp:422: warning: dereferencing pointer 'PyGRTFunctionObjectType.327' does break strict-aliasing rules
 * python_module.cpp:422: warning: dereferencing pointer 'PyGRTFunctionObjectType.327' does break strict-aliasing rules
 * mforms_wrap.cxx:16548: warning: dereferencing pointer '_Py_TrueStruct.3923' does break strict-aliasing rules
 * mforms_wrap.cxx:16548: warning: dereferencing pointer '_Py_TrueStruct.3923' does break strict-aliasing rules
 * mforms_wrap.cxx:16548: warning: dereferencing pointer '_Py_ZeroStruct.3924' does break strict-aliasing rules
 * mforms_wrap.cxx:16548: warning: dereferencing pointer '_Py_ZeroStruct.3924' does break strict-aliasing rules

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * src/reporting.cpp:650: warning: array subscript is above array bounds

 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: http://dev.mysql.com/workbench/
 * ERROR: dev-db/mysql-workbench-5.2.31 failed:
 *   install aborted due to poor programming practices shown above

Build log can be provided if that will help.

How to repeat:
# FEATURES=stricter emerge -1 =dev-db/mysql-workbench-5.2.31
[13 Apr 2011 3:01] Alfredo Kojima
suggest removing -fstrict-aliasing from compiler flags if that's enabled.
[8 May 2011 3:53] Dan Wallis
How/why is this not a bug?

http://gcc.gnu.org/ml/gcc-help/2006-08/msg00240.html

Dereferencing pointer type punned will break strict-aliasing rules

A quote:
<< The most common warning you will see is probably "dereferencing type-
punned pointer will break strict-aliasing rules".  The place where it
warns is in general not wrong -- what gcc tries to tell you is that you
will break the aliasing rules when you dereference the pointer later
(unless you cast it back to its original type first).  This warning
should be interpreted as saying that your interfaces are badly designed,
and the correct way to avoid the warning is to redesign them in a way
where you do not need to cast between conflicting types.  (Even if you
often can make this warning go away by changing void** to void*...) >>

Please read the actual standard too.  The rules about pointer type
conversions are at 6.3.2.3.  The appropriate paragraphs are paragraphs
1 and 7.

http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf
[8 May 2011 17:37] Alfredo Kojima
This is an issue with the Python API. Suggest using -fno-strict-aliasing or file a bug against Python developers. http://mail.python.org/pipermail/python-dev/2003-July/036898.html
In any case, this only happens because Gentoo (which is an unsupported platform) adds extra things to CFLAGS/CXXFLAGS