Bug #57994 Compiler flag change build error : my_redel.c
Submitted: 4 Nov 2010 19:39 Modified: 11 Dec 2010 17:34
Reporter: Karen Langford Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.53 OS:Linux
Assigned to: Davi Arnaut CPU Architecture:Any

[4 Nov 2010 19:39] Karen Langford
Description:
Change to compiler caused build failure on :
skade03.norway.sun.com / linux-i686 / i686-pc-linux-gnu
skade04.norway.sun.com / linux-x86_64 / x86_64-unknown-linux-gnu

ccache /usr/local/gcc-4.3.2/bin/gcc -static-libgcc -DDEFAULT_BASEDIR=\"/usr/local/mysql\" -DMYSQL_DATADIR="\"/usr/local/mysql/data\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\"" -DSHAREDIR="\"/usr/local/mysql/share\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="\"/usr/local/mysql/etc\"" -DHAVE_CONFIG_H -I. -I../include -I../zlib -I../include -I../include -I.   -Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror -g  -DSAFE_MUTEX -g -O -march=i686   -DUNIV_LINUX -DUNIV_LINUX -MT my_redel.o -MD -MP -MF .deps/my_redel.Tpo -c -o my_redel.o my_redel.c
cc1: warnings being treated as errors
my_redel.c: In function 'my_redel':
my_redel.c:57: error: value computed is not used
gmake[1]: *** [my_redel.o] Error 1
gmake[1]: Leaving directory `/export/home/my/tmp-201011011924-5.1.53-4730/linux-x86/mysql-5.1.53/mysys'
gmake: *** [all-recursive] Error 1

How to repeat:
Build 5.1.53 without flag --enable-mysql-maintainer-mode=no
[10 Nov 2010 21:15] 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/123501

3503 Davi Arnaut	2010-11-10
      Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure
      Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c
      Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c
      Bug#57994: Compiler flag change build error : my_redel.c
      Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c
      Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c
      Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc
      
      Fix assorted compiler generated warnings.
     @ cmd-line-utils/readline/bind.c
        Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c
        
        Initialize variable to work around a false positive warning.
     @ include/m_string.h
        Bug#57994: Compiler flag change build error : my_redel.c
        
        The expansion of stpcpy (in glibc) causes warnings if the
        return value of strmov is not being used. Since stpcpy is
        a GNU extension and the expansion ends up using a built-in
        provided by GCC, use the compiler provided built-in directly
        when possible.
     @ include/my_compiler.h
        Define a dummy MY_GNUC_PREREQ when not compiling with GCC.
     @ libmysql/libmysql.c
        Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure
        
        Variable might not be used in some cases. So, tag it as unused.
     @ mysys/mf_keycache.c
        Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c
        
        Use UNINIT_VAR to work around a false positive warning.
     @ mysys/my_getncpus.c
        Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c
        
        Declare variable in the same block where it is used.
     @ regex/regexec.c
        Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c
        
        Work around a compiler bug which causes the cast to not be enforced.
     @ sql/debug_sync.cc
        Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc
        
        Use UNINIT_VAR to work around a false positive warning.
     @ sql/handler.cc
        Use UNINIT_VAR to work around a false positive warning.
     @ sql/slave.cc
        Use UNINIT_VAR to work around a false positive warning.
     @ sql/sql_partition.cc
        Use UNINIT_VAR to work around a false positive warning.
     @ storage/myisam/ft_nlq_search.c
        Use UNINIT_VAR to work around a false positive warning.
     @ storage/myisam/mi_create.c
        Use UNINIT_VAR to work around a false positive warning.
     @ storage/myisammrg/myrg_open.c
        Use UNINIT_VAR to work around a false positive warning.
     @ tests/mysql_client_test.c
        Change function to take a pointer to const, no need for a cast.
[12 Nov 2010 14:32] Jon Olav Hauglid
Ok to push.
[16 Nov 2010 9:46] Davi Arnaut
Pushed into mysql-5.1-bugteam and up.
[17 Nov 2010 9: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/124115

3508 Davi Arnaut	2010-11-17
      Bug#57994: Compiler flag change build error : my_redel.c
      
      Use __builtin_stpcpy only if the system supports stpcpy.
      This is necessary as in some cases a call to stpcpy will
      be emitted if the built-in can not optimized.
     @ include/m_string.h
        The expansion of stpcpy (in glibc) causes warnings if the
        return value of strmov is not being used. Since stpcpy is
        a GNU extension and the expansion ends up using a built-in
        provided by GCC, use the compiler provided built-in directly
        when possible. Nonetheless, the C library must have stpcpy
        as a call be emitted if the built-in can not optimized.
[20 Nov 2010 0:50] Paul DuBois
Noted in 5.1.54, 5.5.8 changelogs.

Several compilation problems were fixed.
[20 Nov 2010 14: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/124544

3513 Davi Arnaut	2010-11-20
      Bug#57994: Compiler flag change build error : my_redel.c
      
      Although ICC identifies itself as GCC, even in version numbers,
      it does not support the stpcpy built-in.
     @ include/m_string.h
        Work around ICC. Hacks...
[5 Dec 2010 12:40] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[15 Dec 2010 5:52] Bugs System
Pushed into mysql-5.1 5.1.55 (revid:sunanda.menon@oracle.com-20101215054055-vgwki317xg1wphhh) (version source revid:sunanda.menon@oracle.com-20101215054055-vgwki317xg1wphhh) (merge vers: 5.1.55) (pib:23)
[16 Dec 2010 22:29] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)