[Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.50,2.51
Neil Schemenauer
nascheme@users.sourceforge.net
Mon, 22 Oct 2001 19:19:12 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv26538/Include
Modified Files:
pyerrors.h
Log Message:
Add function attributes that allow GCC to check the arguments of printf-like
functions.
Index: pyerrors.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v
retrieving revision 2.50
retrieving revision 2.51
diff -C2 -d -r2.50 -r2.51
*** pyerrors.h 2001/10/05 21:50:08 2.50
--- pyerrors.h 2001/10/23 02:19:10 2.51
***************
*** 78,82 ****
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
! extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...);
#ifdef MS_WINDOWS
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
--- 78,83 ----
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, 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 *);
***************
*** 127,132 ****
#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);
#else
# define PyOS_vsnprintf vsnprintf
--- 128,135 ----
#ifndef HAVE_SNPRINTF
#include <stdarg.h>
! 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