Compilation warnings

Bug #1010950 reported by Michael on 2012-06-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to

Bug Description

I used default C and C++ flags.

I checked warnings for MySQL 5.5.25 (i did no find MySQL 5.5.24? sorry). This is Percona Server-specific warnings:

/home/testuser/Percona-Server-5.5.24-rel26.0/sql/ warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/testuser/Percona-Server-5.5.24-rel26.0/sql/ warning: dereferencing type-punned pointer will break strict-aliasing rules

all ather warnings is the same in MySQL 5.5.25 and Percona-Server-5.5.24-rel26.0 .

Alexey Kopytov (akopytov) wrote :

The code on specified lines is not Percona (AFAIK we don't have modifications to at all). So they cannot be specific to Percona:

17561 having->compile(&Item::cache_const_expr_analyzer, (uchar **)&analyzer_arg,
17562 &Item::cache_const_expr_transformer, (uchar *)&cache_flag);
17564 for (JOIN_TAB *tab= join_tab + const_tables; tab < join_tab + tables ; tab++)
17565 {
17566 if (*tab->on_expr_ref)
17567 {
17568 cache_flag= FALSE;
17569 (*tab->on_expr_ref)->compile(&Item::cache_const_expr_analyzer,
17570 (uchar **)&analyzer_arg,
17571 &Item::cache_const_expr_transformer,
17572 (uchar *)&cache_flag);

With reference to, I just tested with following: (PS 5.5.27-28.0)

export CFLAGS="-Wall -O1 -g -static-libgcc -fno-omit-frame-pointer -Wstrict-aliasing=1 -Werror=strict-aliasing -fstrict-aliasing"
export CXXFLAGS="-O1 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -Wstrict-aliasing=1 -Werror=strict-aliasing -fstrict-aliasing"

and it built fine. -Wstrict-aliasing=1 enforces strictest aliasing rules.

On a related note, a blanket -Wall -Werror won't build. There is also a certain
CMake 'issue' which may be responsible for this. During feature testing, cmake
passes the Werror flag which causes test to fail and some cmake detection to
fail. -- the right one is where Werror was passed
and many failed. The CMake 'issue' is
mentioned here but they haven't fixed it, instead they recommend to use
CHECK_SYMBOL_EXISTS which again is not equivalent.

For -Werror we should just rely on MYSQL_MAINTAINER_MODE to turn it on.

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.