Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6b687f

Browse files
committed
remove support GCC PyArg_ParseTuple format patch, last seen in 2006
1 parent fa6bdc6 commit f6b687f

5 files changed

Lines changed: 1 addition & 69 deletions

File tree

Include/modsupport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
2626
/* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */
2727
#if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
2828
PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
29-
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
29+
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
3030
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
3131
const char *, char **, ...);
3232
PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);

Include/pyport.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,6 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
831831
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
832832
#endif
833833

834-
/*
835-
* Add PyArg_ParseTuple format where available.
836-
*/
837-
#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
838-
#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2)))
839-
#else
840-
#define Py_FORMAT_PARSETUPLE(func,p1,p2)
841-
#endif
842-
843834
/*
844835
* Specify alignment on compilers that support it.
845836
*/

configure

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6523,44 +6523,6 @@ then
65236523
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
65246524
fi
65256525

6526-
# Check whether GCC supports PyArg_ParseTuple format
6527-
if test "$GCC" = "yes"
6528-
then
6529-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple __format__" >&5
6530-
$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
6531-
save_CFLAGS=$CFLAGS
6532-
CFLAGS="$CFLAGS -Werror -Wformat"
6533-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6534-
/* end confdefs.h. */
6535-
6536-
void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
6537-
int
6538-
main ()
6539-
{
6540-
6541-
;
6542-
return 0;
6543-
}
6544-
6545-
_ACEOF
6546-
if ac_fn_c_try_compile "$LINENO"; then :
6547-
6548-
6549-
$as_echo "#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1" >>confdefs.h
6550-
6551-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6552-
$as_echo "yes" >&6; }
6553-
6554-
else
6555-
6556-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6557-
$as_echo "no" >&6; }
6558-
6559-
fi
6560-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6561-
CFLAGS=$save_CFLAGS
6562-
fi
6563-
65646526
# On some compilers, pthreads are available without further options
65656527
# (e.g. MacOS X). On some of these systems, the compiler will not
65666528
# complain if unaccepted options are passed (e.g. gcc on Mac OS X).

configure.ac

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,24 +1328,6 @@ then
13281328
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
13291329
fi
13301330

1331-
# Check whether GCC supports PyArg_ParseTuple format
1332-
if test "$GCC" = "yes"
1333-
then
1334-
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
1335-
save_CFLAGS=$CFLAGS
1336-
CFLAGS="$CFLAGS -Werror -Wformat"
1337-
AC_COMPILE_IFELSE([
1338-
AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
1339-
],[
1340-
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1,
1341-
[Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
1342-
AC_MSG_RESULT(yes)
1343-
],[
1344-
AC_MSG_RESULT(no)
1345-
])
1346-
CFLAGS=$save_CFLAGS
1347-
fi
1348-
13491331
# On some compilers, pthreads are available without further options
13501332
# (e.g. MacOS X). On some of these systems, the compiler will not
13511333
# complain if unaccepted options are passed (e.g. gcc on Mac OS X).

pyconfig.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@
6161
/* Define to 1 if you have the `atanh' function. */
6262
#undef HAVE_ATANH
6363

64-
/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */
65-
#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
66-
6764
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
6865
#undef HAVE_BIND_TEXTDOMAIN_CODESET
6966

0 commit comments

Comments
 (0)