List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 28 1999 10:06pm
Subject:RE: Error found on my_error.c
View as plain text  
>>>>> "Narvaez," == Narvaez, Teresa <Teresa.Narvaez@stripped>
> writes:

Narvaez,> Hello,
Narvaez,> 	Thanks for your reply. 	This is the program I wrote to test 
Narvaez,> that va_arg compiles.  I kept it simple because I just wanted to 
Narvaez,> prove that gcc will be able to compile it.   
Narvaez,> 	I looked into my gcc-lib and did find 'stdarg.h'.  What could
Narvaez,> be the problem? This error keeps coming up. 

Narvaez,> Thank you, Teresa

Narvaez,> 	gcc -o testhash testhash.o libmysys.a ../dbug/libdbug.a
Narvaez,> ../strings/libmystrings.a -l
Narvaez,> 	m -lpthread -lmach -lexc -lc
Narvaez,> 	collect2: ld returned 1 exit status
Narvaez,> 	/bin/ld:
Narvaez,> 	Unresolved:
Narvaez,> 	__builtin_va_start
Narvaez,> 	*** Exit 1
Narvaez,> 	Stop.

Narvaez,> ===== beginning of program 

Narvaez,> #include<stdio.h>
Narvaez,> #include<varargs.h>

Narvaez,> main()
Narvaez,> {
Narvaez,>   char     *par;
Narvaez,>   int      index=0;
Narvaez,>   va_list  ap;


Narvaez,>   va_start(ap);

Narvaez,>   par = va_arg(ap, char *);
Narvaez,>   fprintf(stderr,"\npar =  %s\n\n",par);

Narvaez,>   va_end(ap);

Narvaez,> } /* main */

Hi!

Note that the above does only test varargs (the old interface) and not 
the newer interface, stdarg, that MySQL uses!

Could you try again, but with the following program:

#include<stdio.h>
#include<stdarg.h>

int foo(int nr,...)
{
  char     *par;
  int      index=0;
  va_list  ap;

  va_start(ap,nr);

  par = va_arg(ap, char *);
  fprintf(stderr,"\npar =  %s\n\n",par);
  va_end(ap);
} 


main()
{
  foo(1,"1");
  exit(0);
}

Regards,
Monty
Thread
Error found on my_error.cTeresa Narvaez23 Sep
Re: Error found on my_error.csasha23 Sep
RE: Error found on my_error.cTeresa Narvaez23 Sep
RE: Error found on my_error.cJani Tolonen24 Sep
RE: Error found on my_error.cMichael Widenius24 Sep
RE: Error found on my_error.cTeresa Narvaez24 Sep
RE: Error found on my_error.cMichael Widenius24 Sep
RE: Error found on my_error.cTeresa Narvaez27 Sep
RE: Error found on my_error.cMichael Widenius28 Sep
RE: Error found on my_error.cTeresa Narvaez28 Sep
RE: Error found on my_error.cbpaduraru28 Sep
  • RE: Error found on my_error.cBob Kline28 Sep
RE: Error found on my_error.cMichael Widenius29 Sep