Bug #6388 Make fails because 'bzero' undeclared
Submitted: 2 Nov 2004 15:56 Modified: 31 Jul 2005 21:51
Reporter: Sasa Ivanovic Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.1.7 OS:Other (QNX Neutrinos 6.3.0)
Assigned to: CPU Architecture:Any

[2 Nov 2004 15:56] Sasa Ivanovic
Description:
Hi and thanks for any help !

I'm trying to build the server on QNX Neutrino 6.3.0.
I'm using Gnu V3.3.1.

After running configure, I executed make.
When compiling mysql.cc it fails with 'bzero' undeclared.

make[2]: Entering directory `/home/ivanovic/mysql-4.1.7/client'
source='mysql.cc' object='mysql.o' libtool=no \
depfile='.deps/mysql.Po' tmpdepfile='.deps/mysql.TPo' \
depmode=gcc /bin/sh ../depcomp \
QCC -V3.3.1,gcc_ntox86_gpp -DUNDEF_THREADS_HACK -I. -I. -I.. -I../include     -O
3 -DDBUG_OFF    -fno-implicit-templates -fno-exceptions -fno-rtti -c -o mysql.o
`test -f 'mysql.cc' || echo './'`mysql.cc
mysql.cc: In function `int main(int, char**)':
mysql.cc:391: error: `bzero' undeclared (first use this function)
mysql.cc:391: error: (Each undeclared identifier is reported only once for each 
   function it appears in.)

I found that configure already reporte a conflict with the gnu built in bzero (lines below)

configure:32984: checking for bzero
configure:33042: qcc -V3.3.1,gcc_ntox86 -o conftest -O3 -DDBUG_OFF      conftest.c -lsocket -lm  >&5
configure:33143: warning: conflicting types for built-in function `bzero'
configure:33045: $? = 0
configure:33048: test -s conftest
configure:33051: $? = 0
configure:33062: result: yes

I'm glad if anyone could help me with this.

Yours Sasa

How to repeat:
run configure and make on qnx 6.3.0
[3 Nov 2004 7:39] Sasa Ivanovic
FYI: I could avoid the compiler errors by adding a macro to config.h which calls __builtin_bzero instead of bzero. But I'm not sure if this is the right solution and works fine.

Regards, Sasa
[17 Dec 2004 23:36] Georg Schwarz
I'm seeing the same problem (also tried 4.1.7) or IRIX 5.3 where bzero() is defined in bstring.h. I added
#ifdef NEEDS_BSTRING_H                  // defines bzero()
#include <bstring.h>
#endif

to client/mysql.cc and client/completion_hash.cc, then added -DNEEDS_BSTRING_H to CFLAGS. Would of course be nice if that was detected automatically by configure.
[31 Jul 2005 21:51] Jorge del Conde
I was unable to reproduce this problem in our QNX server.

Also,

mysqldev@buildqnx2:~/jorge> cat t.c
#include <stdio.h>

void main()
{
char *x;
bzero((char *)x, 10);
}
mysqldev@buildqnx2:~/jorge> make t
cc     t.c   -o t
t.c: In function `main':
t.c:6: warning: return type of `main' is not `int'
mysqldev@buildqnx2:~/jorge>