bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] gtar build error on solaris 2.5.1 (vsnprintf)


From: Nesius, Robert
Subject: [Bug-tar] gtar build error on solaris 2.5.1 (vsnprintf)
Date: Wed, 6 Apr 2005 15:15:56 -0700

I ran into a build error on Solaris 2.5.1 with the latest gtar.  gtar
wants vsnprintf, which doesn't exist on solaris 2.5.1 (at least on the
box I have.) I googled on the error and found other projects running
into this problem on this platform, but no specific mention of gtar.  

I also went through the list archives before writing and came up blank.
It seems the code where vsnprintf is being used relies on the
bounds-protection of svnprintf to not overflow a buffer.  Are there any
known workarounds for this?  Or, is there a compatability library out
there that implements vsnprintf functionality on systems that don't have
it?  Seems like tar shouldn't rely vsnprintf if it doesn't exist.  

Thanks in advance hints/ideas/workarounds,
-Rob

The error:
gmake[2]: Nothing to be done for `all'.
Making all in src
/usr/intel/pkgs/gcc/3.2/bin/gcc  -L/usr/intel/pkgs/libgettext/0.14.3/lib
-I/usr/intel/pkgs/libgettext/0.14.3/lib -O2   -o tar  buffer.o compare.o
create.o delete.o extract.o xheader.o incremen.o list.o mangle.o misc.o
names.o sparse.o system.o tar.o update.o utf8.o ../lib/libtar.a -lintl
-lposix4 
../lib/libtar.a(argp-fmtstream.o): In function `argp_fmtstream_printf':
argp-fmtstream.o(.text+0x7a8): undefined reference to `vsnprintf'
collect2: ld returned 1 exit status
gmake[2]: *** [tar] Error 1
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all] Error 2
[psus0102]-> /fs3/comp.apps_build.1/gtar/sol25/tar-1.15.1 >

The code: 
lib/argp-fmtstream.c
     42 #if defined _LIBC && defined USE_IN_LIBIO
     43 # include <wchar.h>
     44 # include <libio/libioP.h>
     45 # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
     46 #endif 
...
    406 ssize_t
    407 __argp_fmtstream_printf (struct argp_fmtstream *fs, const char
*fmt, ...)
    408 {
    409   int out;
    410   size_t avail;
    411   size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to
reserve. */
    412
    413   do
    414     {
    415       va_list args;
    416
    417       if (! __argp_fmtstream_ensure (fs, size_guess))
    418         return -1;
    419
    420       va_start (args, fmt);
    421       avail = fs->end - fs->p;
--> 422       out = __vsnprintf (fs->p, avail, fmt, args);
    423       va_end (args);
    424       if ((size_t) out >= avail)
    425         size_guess = out + 1;
    426     }
    427   while ((size_t) out >= avail);
    428
    429   fs->p += out;
    430
    431   return out;
    432 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]