Bug #53445 | Build with -Wall and fix warnings that it generates | ||
---|---|---|---|
Submitted: | 5 May 2010 17:16 | Modified: | 14 Oct 2010 14:55 |
Reporter: | Mark Callaghan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 5.1, all | OS: | Any |
Assigned to: | Davi Arnaut | CPU Architecture: | Any |
Tags: | best, practices |
[5 May 2010 17:16]
Mark Callaghan
[5 May 2010 17:57]
Mark Callaghan
It would be even better to use -Werror with -Wall
[5 May 2010 19:00]
Daniel Fischer
In principle, you are right, and in theory, I have the same opinion. (And complaining about the warnings is part of my job, sometimes.) But in theory, theory is the same as practice, while in practice, ... well. There is an ongoing effort to reduce the number of warnings. Currently, we have several thousand warnings on certain platforms. They have a tendency to pop up suddenly, and in groups, long after the code that is being warned about is written. Removing them takes time. At the same time, most of them are just not quite as important as certain other bugs. I'm sure that you would agree on this as well. Unfortunately, we can't tell which ones are important, and fix those first. But we are fixing them, and for internal testing, we are building with -Wall. (Building with -Werror would be quite useless at this stage. I've suggested it too, but right now, it would just block all other work that is being done.) Btw., there is no internal demand that releases are built without warnings. These builds simply don't happen at a time where it makes sense to still fix them. On the other hand, enabling them could mask more serious deviations. We run hundreds of test builds every day (really), and it makes sense to monitor warnings there; but then, what I said before applies of course, it's still a lot of work.
[5 May 2010 22:43]
Arjen Lentz
Daniel, I appreciate the problem in working out which are the most important - however then a productive approach would be "start at the top and keep going". It will indeed take time, and thus the only way to get anywhere is to get started.
[5 May 2010 22:47]
Arjen Lentz
By the way, I tried to get this actioned around 2002-2003 when I was in Docs. As a C coder myself, I know that effectively ignoring warnings can mask serious problems, since a warning *can* indicate a problem however if it's hiding behind thousands of others you won't see it. If it had been actioned then, we'd be about 8 years ahead of the position the code is now. Hence my suggestion to "just get going". Drizzle did it, and MariaDB is working on it also. It's very important and should receive resourcing. It'll save money later as it will catch some nasty bugs early.
[5 May 2010 23:05]
Davi Arnaut
We have been fixing quite a bunch of compiler warnings for a several months now (5.1 and up, don't expect to on anything below). This is a incremental work and is being performed much before drizzle or whatever. We also not only look into warnings generated by gcc, but by quite a few compilers (some proprietary compilers are quite good at detecting half-backed C++). On this bug, whether the build team uses -Wall is mostly irrelevant, this is a task of the development team. We (team) generally use build scripts and -Wall enabled and quite a few other flags associated with compiler warnings (look into BUILD/), likewise for the development build system. Keep in mind that we are also constrained on what can be done for certain structures that are part of the ABI and for warnings that are bogus (gcc has a ton of those. eg: uninitialized related warnings are simply wrong on C++). There are also the difference between versions, et cetera ad infinitum. Fewer compiler warnings is a long term goal. Anyway, this bug is a bit bogus. Just because we don't advertise it, it doesn't mean its not happening. I can list patches and bug reports if necessary.
[5 May 2010 23:13]
Davi Arnaut
One example: Bug#43414 -- five or more patches fixing assorted compiler warnings.
[5 May 2010 23:30]
Davi Arnaut
Support for automake silent-rules was also added recently to improve highlighting of warnings.
[5 May 2010 23:48]
Davi Arnaut
Some numbers. I've just compiled mysql-5.1-bugteam with -Wall. Number (*) of warnings are: It generates 102979 compilers warnings -- quite a few are repeated due to warning in headers. 102849 warnings are about unused parameters -- mostly due to headers again, cosmetic stuff (**). Removing the above leaves us with 130 warnings. 3 are about a implicit declaration in third-party code. 78 about signedness in the usage of my_bcmp. 1 about unused function. 2 about mismatch in expected types. * Includes warnings for third-party stuff that we ship (readline, yassl, etc). ** There is some internal debate on the usefulness of fixing those in contrast with tempering with revision history, etc. Sometimes we also forget about some nice C++ features..
[5 May 2010 23:50]
Davi Arnaut
The CXXFLAGS was based upon BUID/compile-pentium-valgrind-max-no-ndb with -Wall. It uses -O0.
[6 May 2010 0:05]
Davi Arnaut
Now the above with -O2 (*): Total of 103483 compiler generated warnings. 103155 about unused parameter. Some ~150 in third-party code (array subscript in blowfish.cpp). Same warnings as described above. 37 warnings about strict-aliasing rules 30 warnings about uninitialized use (a good chunk in C++ code -- that is, bogus). 46 about string literal comparison (in a header, yassl code). * Rarely used by developers, makes debugging a pain -- gdb problem, latest version should bring some improvements. Slows down compilation too -- a bit relevant, can be worked around with ccache.
[6 May 2010 0:10]
Davi Arnaut
The high number of "unused parameter" is mostly due to headers. Should be reduce a bit now due to the header reorganization in trunk. A good chunk (+50% i guess) comes from the item*, field* and handler headers.
[6 May 2010 0:15]
Davi Arnaut
Also note that the build scripts we (at least i) developers use are usually derived from -Wall, minus the stuff that does not matter much for us or hinders debuggability (warnings that only work on higher optimization levels) .
[6 May 2010 0:37]
Davi Arnaut
FWIW, we could probably introduce -Werror with a temporary exception (via -Wno-error) for the somewhat irrelevant stuff (eg. unused parameter, ..).
[6 May 2010 7:32]
Konstantin Osipov
Davi, do it.
[6 May 2010 12:34]
Vladislav Vaintroub
We're not only building on GCC btw. Other compilers are better at finding warnings and they find different warnings. HP compiler is excellent at finding potential bugs, and also Microsoft compiler find stuff that GCC will never find (type size mismatch, for GCC passing pointer to bool instead of bool is just fine not for Microsoft though)
[6 May 2010 20:45]
Sveta Smirnova
Maybe we can add -Wall and add -Wno* if needed to be sure we don't occasionally miss something important?
[20 May 2010 15:09]
Davi Arnaut
About the unused parameters warnings: I was using -Wunused-parameter which is not activated by -Wall by default. So we are around ~150 warnings with -Wall. Mileage may vary depending on specific compiler versions and/or options.
[25 May 2010 14:41]
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/109194 3059 Tor Didriksen 2010-05-25 Bug #53445 Build with -Wall and fix warnings that it generates Add -Wall to gcc/g++ Fix (almost) all warnings reported in dbg and opt mode. @ cmd-line-utils/libedit/filecomplete.c Remove unused auto variables. @ configure.cmake Add -Wall to gcc. @ extra/comp_err.c Cast to correct type. @ extra/perror.c Fix segfault (but warnings about deprecated features remain) @ extra/yassl/taocrypt/include/runtime.hpp Comparing two literals was reported as undefined behaviour. @ mysys/lf_alloc-pin.c Initialize pointer. @ sql/mysqld.cc Use UNINIT_VAR rather than LINT_INIT. @ sql/partition_info.cc Use UNINIT_VAR rather than LINT_INIT. @ sql/rpl_handler.cc Use char[] rather than unsigned long[] array for placement buffer. @ sql/spatial.cc Use char[] rather than unsigned void*[] array for placement buffer. @ sql/spatial.h Use char[] rather than unsigned void*[] array for placement buffer. @ sql/sql_partition.cc Initialize auto variable. @ sql/sql_table.cc Initialize auto variables. Add parens around assignment within if() @ sql/sys_vars.cc Use UNINIT_VAR. @ storage/innobase/os/os0file.c Init first slot in auto variable. @ storage/myisam/mi_create.c Use UNINIT_VAR rather than LINT_INIT. @ storage/myisam/mi_open.c Remove (wrong) casting. @ storage/myisam/mi_page.c Remove (wrong) casting. @ storage/myisam/mi_search.c Cast to uchar* rather than char*. @ strings/ctype-ucs2.c Use UNINIT_VAR rather than LINT_INIT. Add (uchar*) casting. @ strings/dtoa.c Perform operations on union variables rather than on doubles.
[26 May 2010 14:12]
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/109289 3066 Tor Didriksen 2010-05-26 Bug #53445 Build with -Wall and fix warnings that it generates Add -Wall to gcc/g++ Fix most warnings reported in dbg and opt mode. @ cmd-line-utils/libedit/filecomplete.c Remove unused auto variables. @ configure.cmake Add -Wall to gcc. @ extra/comp_err.c Cast to correct type. @ extra/perror.c Fix segfault (but warnings about deprecated features remain) @ extra/yassl/taocrypt/include/runtime.hpp Comparing two literals was reported as undefined behaviour. @ include/my_global.h Add a template for aligning character buffers. @ mysys/lf_alloc-pin.c Initialize pointer. @ sql/mysqld.cc Use UNINIT_VAR rather than LINT_INIT. @ sql/partition_info.cc Use UNINIT_VAR rather than LINT_INIT. @ sql/rpl_handler.cc Use char[] rather than unsigned long[] array for placement buffer. @ sql/spatial.cc Use char[] rather than unsigned void*[] array for placement buffer. @ sql/spatial.h Use char[] rather than unsigned void*[] array for placement buffer. @ sql/sql_partition.cc Initialize auto variable. @ sql/sql_table.cc Initialize auto variables. Add parens around assignment within if() @ sql/sys_vars.cc Use UNINIT_VAR. @ storage/innobase/os/os0file.c Init first slot in auto variable. @ storage/myisam/mi_create.c Use UNINIT_VAR rather than LINT_INIT. @ storage/myisam/mi_open.c Remove (wrong) casting. @ storage/myisam/mi_page.c Remove (wrong) casting. @ storage/myisam/mi_search.c Cast to uchar* rather than char*. @ strings/ctype-ucs2.c Use UNINIT_VAR rather than LINT_INIT. Add (uchar*) casting.
[26 May 2010 14:57]
Tor Didriksen
Pushed to bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-trunk-bugfixing/
[27 May 2010 7:43]
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/109315 3067 Tor Didriksen 2010-05-27 Bug #53445 Build with -Wall and fix warnings that it generates Post-push fix: -Wall implies -Wunused on some platforms, which will generate thousands of warnings about unused parameters. @ configure.cmake Do not warn about unused parameters in C++
[27 May 2010 23:32]
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/109434 3071 Davi Arnaut 2010-05-27 Bug#53445: Build with -Wall and fix warnings that it generates Fix various mismatches between function's language linkage. Any particular function that is declared in C++ but should be callable from C must have C linkage. Note that function types with different linkages are also distinct. Thus, if a function type is declared in C code, it will have C linkage (same if declared in a extern "C" block). @ client/mysql.cc Mismatch between prototype and declaration. @ client/mysqltest.cc mysqltest used to be C code. Use C linkage where appropriate. @ cmd-line-utils/readline/input.c Isolate unreachable code. @ include/my_alloc.h Function type must have C linkage. @ include/my_base.h Function type must have C linkage. @ include/my_global.h Add helper macros to avoid spurious namespace indentation. @ include/mysql.h.pp Update ABI file. @ mysys/my_gethwaddr.c Remove stray carriage return. @ plugin/semisync/semisync_master_plugin.cc Callback function types have C linkage. @ plugin/semisync/semisync_slave_plugin.cc Callback function types have C linkage. @ sql/derror.cc Expected function type has C linkage. @ sql/field.cc Use helper macro and fix indentation. @ sql/handler.cc Expected function type has C linkage. @ sql/item_sum.cc Correct function linkages. Remove now unnecessary cast. @ sql/item_sum.h Add prototypes with the appropriate linkage as otherwise they are distinct. @ sql/mysqld.cc Wrapp functions in C linkage mode. @ sql/opt_range.cc C language linkage is ignored for class member functions. @ sql/partition_info.cc Add wrapper functions with C linkage for class member functions. @ sql/rpl_utility.h Use helper macro and fix indentation. @ sql/sql_class.cc Use helper macro and fix indentation. @ sql/sql_select.cc Expected function type has C linkage. @ sql/sql_show.cc Expected function type has C linkage. @ sql/sql_test.cc Expected function type has C linkage. @ storage/myisammrg/ha_myisammrg.cc Expected function type has C linkage. @ storage/perfschema/pfs.cc PSI headers are declared with C language linkage, which also applies to function types.
[31 May 2010 15:30]
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/109632 3080 Davi Arnaut 2010-05-31 Bug#53445: Build with -Wall and fix warnings that it generates Fix various mismatches between function's language linkage. Any particular function that is declared in C++ but should be callable from C must have C linkage. Note that function types with different linkages are also distinct. Thus, if a function type is declared in C code, it will have C linkage (same if declared in a extern "C" block). @ client/mysql.cc Mismatch between prototype and declaration. @ client/mysqltest.cc mysqltest used to be C code. Use C linkage where appropriate. @ cmd-line-utils/readline/input.c Isolate unreachable code. @ include/my_alloc.h Function type must have C linkage. @ include/my_base.h Function type must have C linkage. @ include/my_global.h Add helper macros to avoid spurious namespace indentation. @ include/mysql.h.pp Update ABI file. @ mysys/my_gethwaddr.c Remove stray carriage return and fix coding style. @ plugin/semisync/semisync_master_plugin.cc Callback function types have C linkage. @ plugin/semisync/semisync_slave_plugin.cc Callback function types have C linkage. @ sql/derror.cc Expected function type has C linkage. @ sql/field.cc Use helper macro and fix indentation. @ sql/handler.cc Expected function type has C linkage. @ sql/item_sum.cc Correct function linkages. Remove now unnecessary cast. @ sql/item_sum.h Add prototypes with the appropriate linkage as otherwise they are distinct. @ sql/mysqld.cc Wrap functions in C linkage mode. @ sql/opt_range.cc C language linkage is ignored for class member functions. @ sql/partition_info.cc Add wrapper functions with C linkage for class member functions. @ sql/rpl_utility.h Use helper macro and fix indentation. @ sql/sql_class.cc Change type of thd argument -- THD is a class. Use helper macro and fix indentation. @ sql/sql_class.h Change type of thd argument -- THD is a class. @ sql/sql_select.cc Expected function type has C linkage. @ sql/sql_select.h Move prototype to sql_test.h @ sql/sql_show.cc Expected function type has C linkage. @ sql/sql_test.cc Fix required function prototype and fix coding style. @ sql/sql_test.h Removed unnecessary export and add another. @ storage/myisammrg/ha_myisammrg.cc Expected function type has C linkage. @ storage/perfschema/pfs.cc PSI headers are declared with C language linkage, which also applies to function types.
[4 Jun 2010 20:22]
Davi Arnaut
Queued to mysql-trunk-bugfixing. Reset to In Progress to work on 5.1 specific stuff.
[15 Jun 2010 8:15]
Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (merge vers: 5.5.5-m3) (pib:16)
[15 Jun 2010 8:31]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:alik@sun.com-20100615080431-gu5icn0anrt47dsx) (pib:16)
[29 Jun 2010 1:29]
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/112398 3452 Davi Arnaut 2010-06-28 Bug#53445: Build with -Wall and fix warnings that it generates Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the built-in function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since bcmp is a deprecated function whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. Other warnings were due to type mismatches, missing return values and dead code. @ BUILD/SETUP.sh Remove flags that are implied by -Wall and -Wextra. Do not warn about unused parameters in C++. @ BUILD/check-cpu Print only the compiler version instead of verbose banner. Although the option is gcc specific, the check was only being used for GCC specific checks anyway. @ client/mysql.cc bcmp is no longer defined. @ client/mysqltest.cc Pass a string to function expecting a format string. Replace use of bcmp with memcmp. @ cmd-line-utils/readline/Makefile.am Always define _GNU_SOURCE when compiling GNU readline. Required to make certain prototypes visible. @ cmd-line-utils/readline/input.c Condition for the code to be meaningful. @ configure.in Remove check for bcmp. @ extra/comp_err.c Use appropriate type. @ extra/replace.c Replace use of bcmp with memcmp. @ extra/yassl/src/crypto_wrapper.cpp Do not ignore the return value of fgets. Retrieve the file position if fgets succeed -- if it fails, the function will bail out and return a error. @ extra/yassl/taocrypt/include/blowfish.hpp Use a single array instead of accessing positions of the sbox_ through a subscript to pbox_. @ extra/yassl/taocrypt/include/runtime.hpp One definition of such functions is enough. @ extra/yassl/taocrypt/src/aes.cpp Avoid potentially ambiguous conditions. @ extra/yassl/taocrypt/src/algebra.cpp Rename arguments to avoid shadowing related warnings. @ extra/yassl/taocrypt/src/blowfish.cpp Avoid potentially ambiguous conditions. @ extra/yassl/taocrypt/src/integer.cpp Do not define type within a anonymous union. Use a variable to return a value instead of leaving the result in a register -- compiler does not know the logic inside the asm. @ extra/yassl/taocrypt/src/misc.cpp Define handler for pure virtual functions. Remove unused code. @ extra/yassl/taocrypt/src/twofish.cpp Avoid potentially ambiguous conditions. @ extra/yassl/testsuite/test.hpp Function must have C language linkage. @ include/m_string.h Remove check which relied on bcmp being defined -- they weren't being used as bcmp is only visible when _BSD_SOURCE is defined. @ include/my_bitmap.h Remove bogus helpers which were used only in a few files and were causing warnings about dead code. @ include/my_global.h Due to G++ bug, always silence false-positive uninitialized variables warnings when compiling C++ code with G++. Remove bogus helper. @ libmysql/Makefile.shared Remove built-in implementation of bcmp. @ mysql-test/lib/My/SafeProcess/safe_process.cc Cast pid to largest possible type for a process identifier. @ mysys/mf_loadpath.c Leave space of the ending nul. @ mysys/mf_pack.c Replace bcmp with memcmp. @ mysys/my_bitmap.c Dead code removal. @ mysys/my_gethwaddr.c Remove unused variable. @ mysys/my_getopt.c Silence bogus uninitialized variable warning. Do not cast away the constant qualifier. @ mysys/safemalloc.c Cast to expected type. @ mysys/thr_lock.c Silence bogus uninitialized variable warning. @ sql/field.cc Replace bogus helper with a more appropriate logic which is used throughout the code. @ sql/item.cc Remove bogus logical condition which always evaluates to TRUE. @ sql/item_create.cc Simplify code to avoid signedness related warnings. @ sql/log_event.cc Replace use of bcmp with memcmp. No need to use helpers for simple bit operations. @ sql/log_event_old.cc Replace bmove_align with memcpy. @ sql/mysqld.cc Move use declaration of variable to the ifdef block where it is used. Remove now-unnecessary casts and arguments. @ sql/set_var.cc Replace bogus helpers with simple and classic bit operations. @ sql/slave.cc Cast to expected type and silence bogus warning. @ sql/sql_class.h Don't use enum values as bit flags, the supposed type safety is bogus as the combined bit flags are not a value in the enumeration. @ sql/udf_example.c Only declare variable when necessary. @ sql/unireg.h Replace use of bmove_align with memcpy. @ storage/innobase/os/os0file.c Silence bogus warning. @ storage/myisam/mi_open.c Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. @ storage/myisam/mi_page.c Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. @ strings/bcmp.c Remove built-in bcmp. @ strings/ctype-ucs2.c Silence bogus warning. @ tests/mysql_client_test.c Use a appropriate type as expected by simple_command().
[2 Jul 2010 18:06]
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/112794 3458 Davi Arnaut 2010-07-02 Bug#53445: Build with -Wall and fix warnings that it generates Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the in-house function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since my_bcmp and bcmp are deprecated functions whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. There were also various other warnings, mostly due to type mismatches, missing return values, missing prototypes, dead code (unreachable) and ignored return values. @ BUILD/SETUP.sh Remove flags that are implied by -Wall and -Wextra. Do not warn about unused parameters in C++. @ BUILD/check-cpu Print only the compiler version instead of verbose banner. Although the option is gcc specific, the check was only being used for GCC specific checks anyway. @ client/mysql.cc bcmp is no longer defined. @ client/mysqltest.cc Pass a string to function expecting a format string. Replace use of bcmp with memcmp. @ cmd-line-utils/readline/Makefile.am Always define _GNU_SOURCE when compiling GNU readline. Required to make certain prototypes visible. @ cmd-line-utils/readline/input.c Condition for the code to be meaningful. @ configure.in Remove check for bcmp. @ extra/comp_err.c Use appropriate type. @ extra/replace.c Replace use of bcmp with memcmp. @ extra/yassl/src/crypto_wrapper.cpp Do not ignore the return value of fgets. Retrieve the file position if fgets succeed -- if it fails, the function will bail out and return a error. @ extra/yassl/taocrypt/include/blowfish.hpp Use a single array instead of accessing positions of the sbox_ through a subscript to pbox_. @ extra/yassl/taocrypt/include/runtime.hpp One definition of such functions is enough. @ extra/yassl/taocrypt/src/aes.cpp Avoid potentially ambiguous conditions. @ extra/yassl/taocrypt/src/algebra.cpp Rename arguments to avoid shadowing related warnings. @ extra/yassl/taocrypt/src/blowfish.cpp Avoid potentially ambiguous conditions. @ extra/yassl/taocrypt/src/integer.cpp Do not define type within a anonymous union. Use a variable to return a value instead of leaving the result in a register -- compiler does not know the logic inside the asm. @ extra/yassl/taocrypt/src/misc.cpp Define handler for pure virtual functions. Remove unused code. @ extra/yassl/taocrypt/src/twofish.cpp Avoid potentially ambiguous conditions. @ extra/yassl/testsuite/test.hpp Function must have C language linkage. @ include/m_string.h Remove check which relied on bcmp being defined -- they weren't being used as bcmp is only visible when _BSD_SOURCE is defined. @ include/my_bitmap.h Remove bogus helpers which were used only in a few files and were causing warnings about dead code. @ include/my_global.h Due to G++ bug, always silence false-positive uninitialized variables warnings when compiling C++ code with G++. Remove bogus helper. @ libmysql/Makefile.shared Remove built-in implementation of bcmp. @ mysql-test/lib/My/SafeProcess/safe_process.cc Cast pid to largest possible type for a process identifier. @ mysys/mf_loadpath.c Leave space of the ending nul. @ mysys/mf_pack.c Replace bcmp with memcmp. @ mysys/my_bitmap.c Dead code removal. @ mysys/my_gethwaddr.c Remove unused variable. @ mysys/my_getopt.c Silence bogus uninitialized variable warning. Do not cast away the constant qualifier. @ mysys/safemalloc.c Cast to expected type. @ mysys/thr_lock.c Silence bogus uninitialized variable warning. @ sql/field.cc Replace bogus helper with a more appropriate logic which is used throughout the code. @ sql/item.cc Remove bogus logical condition which always evaluates to TRUE. @ sql/item_create.cc Simplify code to avoid signedness related warnings. @ sql/log_event.cc Replace use of bcmp with memcmp. No need to use helpers for simple bit operations. @ sql/log_event_old.cc Replace bmove_align with memcpy. @ sql/mysqld.cc Move use declaration of variable to the ifdef block where it is used. Remove now-unnecessary casts and arguments. @ sql/set_var.cc Replace bogus helpers with simple and classic bit operations. @ sql/slave.cc Cast to expected type and silence bogus warning. @ sql/sql_class.h Don't use enum values as bit flags, the supposed type safety is bogus as the combined bit flags are not a value in the enumeration. @ sql/udf_example.c Only declare variable when necessary. @ sql/unireg.h Replace use of bmove_align with memcpy. @ storage/innobase/os/os0file.c Silence bogus warning. @ storage/myisam/mi_open.c Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. @ storage/myisam/mi_page.c Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. @ strings/bcmp.c Remove built-in bcmp. @ strings/ctype-ucs2.c Silence bogus warning. @ tests/mysql_client_test.c Use a appropriate type as expected by simple_command().
[2 Jul 2010 19:47]
Davi Arnaut
Queued to mysql-5.1-bugteam and up. Automatic compile cycle with -Wall -Wextra -Werror is being set up.
[2 Jul 2010 21:42]
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/112811 3459 Davi Arnaut 2010-07-02 Bug#53445: Build with -Wall and fix warnings that it generates If bzero is not available, resort to memset. Also, remove dead bzero.c
[9 Jul 2010 1:06]
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/113191 3470 Davi Arnaut 2010-07-08 Bug#53445: Build with -Wall and fix warnings that it generates Introduce a MySQL maintainer/developer mode that enables a set of warning options for the C/C++ compiler. This mode is intended to help improve the overall quality of the code. The warning options are: C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror" CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter" @ config/ac-macros/maintainer.m4 Add a set of default compiler flags used when in maintainer mode. @ configure.in Hook into the maintainer mode. Disabled by default.
[9 Jul 2010 11:38]
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/113234 3471 Davi Arnaut 2010-07-09 Bug#53445: Build with -Wall and fix warnings that it generates Introduce a MySQL maintainer/developer mode that enables a set of warning options for the C/C++ compiler. This mode is intended to help improve the overall quality of the code. The warning options are: C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror" CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter" Since -Wall is essentially a moving target, autoconf checks are not run with warning options enabled, in particualr -Werror. This decision might be revisited in the future. The patch also fixes a mistake in the makefiles, where automake CXXFLAGS would be set to CFLAGS. @ config/ac-macros/maintainer.m4 Add a set of default compiler flags used when in maintainer mode. @ configure.in Hook into the maintainer mode. Disabled by default.
[9 Jul 2010 20:15]
Davi Arnaut
Automatic builds in MySQL maintainer mode have been setup and are being done after each push. There is even a successful build already. To a moderate extent, this alone ensures that no new warnings are introduced. This bug is done for now.
[23 Jul 2010 10:58]
MC Brown
A note has been added to the 5.1.50 and 5.5.6 changelog: Builds of MySQL would generate a large number of warnings.
[23 Jul 2010 12:26]
Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100723121820-jryu2fuw3pc53q9w) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (merge vers: 5.5.5-m3) (pib:18)
[23 Jul 2010 12:33]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100723121929-90e9zemk3jkr2ocy) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (pib:18)
[23 Jul 2010 13:38]
MC Brown
Already noted in changelog
[19 Aug 2010 15:40]
Bugs System
Pushed into mysql-5.1 5.1.51 (revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (version source revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (merge vers: 5.1.51) (pib:20)
[14 Oct 2010 8:33]
Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (merge vers: 5.1.51-ndb-7.0.20) (pib:21)
[14 Oct 2010 8:48]
Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (merge vers: 5.1.51-ndb-6.3.39) (pib:21)
[14 Oct 2010 9:02]
Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (merge vers: 5.1.51-ndb-6.2.19) (pib:21)
[14 Oct 2010 14:55]
Jon Stephens
Already documented in the 5.1.50 changelog; no new changelog entries required. setting back to Closed state.