/* Formatted output */
-int bprintf(struct fastbuf *b, byte *msg, ...);
-int vbprintf(struct fastbuf *b, byte *msg, va_list args);
+int bprintf(struct fastbuf *b, char *msg, ...) FORMAT_CHECK(printf,2,3);
+int vbprintf(struct fastbuf *b, char *msg, va_list args);
#endif
#include <alloca.h>
int
-vbprintf(struct fastbuf *b, byte *msg, va_list args)
+vbprintf(struct fastbuf *b, char *msg, va_list args)
{
byte *buf;
int len, r;
}
int
-bprintf(struct fastbuf *b, byte *msg, ...)
+bprintf(struct fastbuf *b, char *msg, ...)
{
va_list args;
int res;
#define PACKED __attribute__((packed))
#define CONST __attribute__((const))
#define PURE __attribute__((const))
+#define FORMAT_CHECK(x,y,z) __attribute__((format(x,y,z)))
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
struct tm;
extern void (*log_switch_hook)(struct tm *tm);
-void log_msg(unsigned int cat, const char *msg, ...) __attribute__((format(printf,2,3)));
+void log_msg(unsigned int cat, const char *msg, ...) FORMAT_CHECK(printf,2,3);
#define log log_msg
void vlog_msg(unsigned int cat, const char *msg, va_list args);
-void die(const char *, ...) NONRET __attribute__((format(printf,1,2)));
+void die(const char *, ...) NONRET FORMAT_CHECK(printf,1,2);
void log_init(byte *argv0);
void log_file(byte *name);
void log_fork(void);
/* proctitle.c */
void setproctitle_init(int argc, char **argv);
-void setproctitle(char *msg, ...) __attribute__((format(printf,1,2)));
+void setproctitle(char *msg, ...) FORMAT_CHECK(printf,1,2);
/* randomkey.c */
/* mempool-fmt.c */
-char *mp_printf(struct mempool *p, char *fmt, ...);
+char *mp_printf(struct mempool *p, char *fmt, ...) FORMAT_CHECK(printf,2,3);
char *mp_vprintf(struct mempool *p, char *fmt, va_list args);
#endif
uns stk_array_len(char **s, uns cnt);
void stk_array_copy(char *x, char **s, uns cnt);
-uns stk_printf_internal(char *x, ...) __attribute__((format(printf,1,2)));
+uns stk_printf_internal(char *x, ...) FORMAT_CHECK(printf,1,2);
extern char *stk_printf_buf;