From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: "Steve Simon" Date: Mon, 11 Oct 2010 02:55:41 +0100 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Python Topicbox-Message-UUID: 6117ea54-ead6-11e9-9d60-3106f5b1d025 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