Bug #2305 Building 4.0.17 on RedHat Enterprise 3 fails
Submitted: 7 Jan 2004 7:26 Modified: 7 Jan 2004 8:08
Reporter: Ryan Dooley Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.17 OS:Linux (Linux (RHEL AS 3))
Assigned to: Dean Ellis CPU Architecture:Any

[7 Jan 2004 7:26] Ryan Dooley
Description:
make[2]: Entering directory `/usr/src/redhat/BUILD/mysql-4.0.17/libmysql_r'
source='libmysql.c' object='libmysql.lo' libtool=yes \
depfile='.deps/libmysql.Plo' tmpdepfile='.deps/libmysql.TPlo' \
depmode=gcc3 /bin/sh ../depcomp \
/bin/sh ../libtool --mode=compile gcc -DDEFAULT_CHARSET_HOME="\"/\"" -DDATADIR="\"/var/lib/mysql\"" -DSHAREDIR="\"/usr/share/mysql\"" -DDONT_USE_RAID  -I. -I. -I.. -I./../include -I../include -I./.. -I.. -I..     -O3 -DDBUG_OFF -O2 -g -march=i386 -mcpu=i686  -c -o libmysql.lo `test -f libmysql.c || echo './'`libmysql.crm -f .libs/libmysql.lo
gcc -DDEFAULT_CHARSET_HOME=\"/\" -DDATADIR=\"/var/lib/mysql\" -DSHAREDIR=\"/usr/share/mysql\" -DDONT_USE_RAID -I. -I. -I.. -I./../include -I../include -I./.. -I.. -I.. -O3 -DDBUG_OFF -O2 -g -march=i386 -mcpu=i686 -c libmysql.c -MT libmysql.lo -MD -MP -MF .deps/libmysql.TPlo  -fPIC -DPIC -o .libs/libmysql.lo
libmysql.c: In function `mysql_real_connect':
libmysql.c:1797: warning: passing arg 5 of `gethostbyname_r' from incompatible pointer type
libmysql.c:1797: too few arguments to function `gethostbyname_r'
libmysql.c:1797: warning: assignment makes pointer from integer without a cast
make[2]: *** [libmysql.lo] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/mysql-4.0.17/libmysql_r'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/mysql-4.0.17'
make: *** [all] Error 2

How to repeat:
rpmbuild --rebuild MySQL-4.0.17.src.rpm

Using the src.rpm from MySQL.com

Suggested fix:
According to the gethostbyname_r documentation the structure is now:

       int gethostbyname_r (const char *name,
         struct hostent *ret, char *buf, size_t buflen,
         struct hostent **result, int *h_errnop);

I'll see if I can get a fix for libmysql_r/libmysql.c and include/my_net.h
[7 Jan 2004 8:04] Ryan Dooley
Wasn't quite what what I thought it was.  According to the user comments at http://www.mysql.com/doc/en/Secure_basics.html installing gcc-c++ (which was needed  any way) fixes the problem.  In fact it appears to so no worries about this *bug* :-)

Thanks, Ryan
[7 Jan 2004 8:08] Dean Ellis
Not a bug, as above.  Thanks for the update.