functions.
#include "pydebug.h"
-DL_IMPORT(void) PySys_WriteStdout(const char *format, ...);
-DL_IMPORT(void) PySys_WriteStderr(const char *format, ...);
+DL_IMPORT(void) PySys_WriteStdout(const char *format, ...)
+ __attribute__((format(printf, 1, 2)));
+DL_IMPORT(void) PySys_WriteStderr(const char *format, ...)
+ __attribute__((format(printf, 1, 2)));
#define addarc _Py_addarc
#define addbit _Py_addbit
extern DL_IMPORT(PyObject *) PyErr_NoMemory(void);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
-extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...);
+extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...)
+ __attribute__((format(printf, 2, 3)));
#ifdef MS_WINDOWS
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int);
#ifndef HAVE_SNPRINTF
#include <stdarg.h>
-extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...);
-extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va);
+extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
+ __attribute__((format(printf, 3, 4)));
+extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
+ __attribute__((format(printf, 3, 0)));
#else
# define PyOS_vsnprintf vsnprintf
# define PyOS_snprintf snprintf
extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int);
extern DL_IMPORT(PyObject *) PyString_FromString(const char *);
-extern DL_IMPORT(PyObject *) PyString_FromFormatV(const char*, va_list);
-extern DL_IMPORT(PyObject *) PyString_FromFormat(const char*, ...);
+extern DL_IMPORT(PyObject *) PyString_FromFormatV(const char*, va_list)
+ __attribute__((format(printf, 1, 0)));
+extern DL_IMPORT(PyObject *) PyString_FromFormat(const char*, ...)
+ __attribute__((format(printf, 1, 2)));
extern DL_IMPORT(int) PyString_Size(PyObject *);
extern DL_IMPORT(char *) PyString_AsString(PyObject *);
extern DL_IMPORT(void) PyString_Concat(PyObject **, PyObject *);
DL_IMPORT(void) PySys_SetArgv(int, char **);
DL_IMPORT(void) PySys_SetPath(char *);
-DL_IMPORT(void) PySys_WriteStdout(const char *format, ...);
-DL_IMPORT(void) PySys_WriteStderr(const char *format, ...);
+DL_IMPORT(void) PySys_WriteStdout(const char *format, ...)
+ __attribute__((format(printf, 1, 2)));
+DL_IMPORT(void) PySys_WriteStderr(const char *format, ...)
+ __attribute__((format(printf, 1, 2)));
extern DL_IMPORT(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
extern DL_IMPORT(int) _PySys_CheckInterval;