I am porting a 3rd party driver that compiles when using gcc 3.4.3. I want to use the more newer version "gcc (GCC) 4.5.2 " that ships as /usr/bin/gcc. However I am not able to resolve the following issue. Any ideas on how to resolve this issue. This is due to a change in gcc which eliminated __builtin_stdarg_start.

nptbld-x:rshoaib:/tmp] (517)>cat y.c
#include <sys/types.h>
#include <strings.h>
#include <sys/varargs.h>


int
ci_sprintf(char *buf, const char *fmt, ...)
{
  va_list args;

#ifdef WORKS
  __builtin_va_start(args, 0);
#else
  va_start(args, fmt);
#endif
  (void) vsnprintf(buf, 100, fmt, args);
  va_end(args);

  return strlen(buf);
}

main()
{
}


[nptbld-x:rshoaib:/tmp] (519)>gcc y.c -o yc
Undefined            first referenced
 symbol                  in file
__builtin_stdarg_start              /var/tmp//ccE.aiTM.o
ld: fatal: symbol referencing errors. No output written to yc
collect2: ld returned 1 exit status

The only way I have been able to work this out is by using __builtin_va_start instead of va_start. That just seems wrong.

Rao.
_______________________________________________
userland-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/userland-discuss

Reply via email to