From f6b687fcd4d62e53443e23376dc02c177fecc0d4 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 12 May 2013 23:08:28 -0500 Subject: remove support GCC PyArg_ParseTuple format patch, last seen in 2006 --- Include/modsupport.h | 2 +- Include/pyport.h | 9 --------- configure | 38 -------------------------------------- configure.ac | 18 ------------------ pyconfig.h.in | 3 --- 5 files changed, 1 insertion(+), 69 deletions(-) diff --git a/Include/modsupport.h b/Include/modsupport.h index ecf1dcc..ab725f6 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -26,7 +26,7 @@ PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); /* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */ #if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); -PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3); +PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, ...); PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *); diff --git a/Include/pyport.h b/Include/pyport.h index 17d9f6d..96e8f1a 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -832,15 +832,6 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #endif /* - * Add PyArg_ParseTuple format where available. - */ -#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE -#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2))) -#else -#define Py_FORMAT_PARSETUPLE(func,p1,p2) -#endif - -/* * Specify alignment on compilers that support it. */ #if defined(__GNUC__) && __GNUC__ >= 3 diff --git a/configure b/configure index a414fe0..725250b 100755 --- a/configure +++ b/configure @@ -6523,44 +6523,6 @@ then BASECFLAGS="$BASECFLAGS $ac_arch_flags" fi -# Check whether GCC supports PyArg_ParseTuple format -if test "$GCC" = "yes" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple __format__" >&5 -$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror -Wformat" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2))); -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$save_CFLAGS -fi - # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). diff --git a/configure.ac b/configure.ac index a70a752..03f9072 100644 --- a/configure.ac +++ b/configure.ac @@ -1328,24 +1328,6 @@ then BASECFLAGS="$BASECFLAGS $ac_arch_flags" fi -# Check whether GCC supports PyArg_ParseTuple format -if test "$GCC" = "yes" -then - AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror -Wformat" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]]) - ],[ - AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, - [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))]) - AC_MSG_RESULT(yes) - ],[ - AC_MSG_RESULT(no) - ]) - CFLAGS=$save_CFLAGS -fi - # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). diff --git a/pyconfig.h.in b/pyconfig.h.in index 4f252dc..2d4536d 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -61,9 +61,6 @@ /* Define to 1 if you have the `atanh' function. */ #undef HAVE_ATANH -/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */ -#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE - /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET -- cgit v0.12