One difference between uClibc and glibc

Jie Zhang jzhang918 at gmail.com
Thu Mar 23 10:00:57 UTC 2006


On 3/23/06, Rich Felker <dalias at aerifal.cx> wrote:
>
> IMO this is a non-issue. Any program that defines an external symbol
> named snprintf is not a conforming C program. Whatever this test
> program redefining snprintf is, it should be fixed...
>
I have any C standards at hand. But from uClibc/include/stdio.h:

#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
__BEGIN_NAMESPACE_C99
/* Maximum chars of output to write in MAXLEN.  */
extern int snprintf (char *__restrict __s, size_t __maxlen,
                     __const char *__restrict __format, ...)
     __THROW __attribute__ ((__format__ (__printf__, 3, 4)));

extern int vsnprintf (char *__restrict __s, size_t __maxlen,
                      __const char *__restrict __format, __gnuc_va_list __arg)
     __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
__END_NAMESPACE_C99
#endif

it seems snprintf () and vsnprintf () are only in C99. For C89/90, we
should be able to redefine snprintf () and vsnprintf () in conforming
user program.

Jie



More information about the uClibc mailing list