Bug #56522 | Compiler warnings in mysys/lf_hash.c | ||
---|---|---|---|
Submitted: | 2 Sep 2010 22:47 | Modified: | 5 Oct 2010 11:29 |
Reporter: | Marc ALFF | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S1 (Critical) |
Version: | 5.5-bugfixing | OS: | Any |
Assigned to: | Marc ALFF | CPU Architecture: | Any |
[2 Sep 2010 22:47]
Marc ALFF
[3 Sep 2010 0:01]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/117471 3203 Marc Alff 2010-09-02 Bug#56522 Compiler warnings in mysys/lf_hash.c Before this fix, the file mysys/lf_hash.c would build with compiler warnings, such as "dereferencing type-punned pointer might break strict-aliasing rules". For GCC in particular, gcc 4.3.2 would generate warnings when compiled with -Wstrict-aliasing=2, and no warnings with -Wstrict-aliasing=3 This fix simplifies the code to avoid complex constructs, and clarifies type casting. With the fix, the build is now clean for both -Wstrict-aliasing=2 -Wstrict-aliasing=3 While all warnings for all compilers / platforms / compiling options may not be fixed, this fix already improves the situation, as well as the readability of the code.
[21 Oct 2010 11:51]
Davi Arnaut
I ended up disabling strict aliasing optimization for release builds http://lists.mysql.com/commits/120381/. So this bug is not very urgent, but we should eventually work towards fixing it. The best approach is to rework the atomic API so it does not require the current amount unsafe type casts.
[21 Oct 2010 11:54]
Davi Arnaut
The correct link is: http://lists.mysql.com/commits/120381