this is a snippet of /sys/include/ape/stdio.h

        extern int scanf(const char *, ...);
        extern int sprintf(char *, const char *, ...);
        #ifdef _C99_SNPRINTF_EXTENSION /* user knows about c99 out-of-bounds 
returns */
        extern int snprintf(char *, size_t, const char *, ...);
        extern int vsnprintf(char *, size_t, const char *, va_list);
        #else
        /* draw errors on any attempt to use *snprintf value so old code gets 
changed */
        extern void snprintf(char *, size_t, const char *, ...);
        extern void vsnprintf(char *, size_t, const char *, va_list);
        #endif
        extern int sscanf(const char *, const char *, ...);
        extern int vfprintf(FILE *, const char *, va_list);

snprintf is a BSD-ism (I beleive) and so is not codeifed in any hard spec.

traditionally it has either returned void, or an int which contains
the number of bytes written to the string.

C99 specifies that the return value is the size for the buffer necessary to
format the arguments, ignoring any length specifier.

These two are mutually exclusive and any code written for the former case
will probably explode if compiled with the latter libraries, hence the 
definition
in stdio.h to catch the unwary.

You should be able to add -D _C99_SNPRINTF_EXTENSION to your mkfile's
CFLAGS definition to make it build.

-Steve

Reply via email to