8000 GH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h … · coderanger/cpython@cb04a09 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb04a09

Browse files
pythonGH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h (python#93215)
1 parent ddc4a78 commit cb04a09

19 files changed

+9
-171
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ Changes in the Python API
144144
Build Changes
145145
=============
146146

147+
* ``va_start()`` with two parameters, like ``va_start(args, format),``
148+
is now required to build Python.
149+
``va_start()`` is no longer called with a single parameter.
150+
(Contributed by Kumar Aditya in :gh:`93207`.)
151+
147152

148153
C API Changes
149154
=============
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``va_start()`` with two parameters, like ``va_start(args, format),``
2+
is now required to build Python. ``va_start()`` is no longer called with a single parameter.
3+
Patch by Kumar Aditya.

Modules/_asynciomodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,11 +2643,7 @@ task_set_error_soon(TaskObj *task, PyObject *et, const char *format, ...)
26432643
PyObject* msg;
26442644

26452645
va_list vargs;
2646-
#ifdef HAVE_STDARG_PROTOTYPES
26472646
va_start(vargs, format);
2648-
#else
2649-
va_start(vargs);
2650-
#endif
26512647
msg = PyUnicode_FromFormatV(format, vargs);
26522648
va_end(vargs);
26532649

Modules/_hashopenssl.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,7 @@ _setException(PyObject *exc, const char* altmsg, ...)
255255
const char *lib, *func, *reason;
256256
va_list vargs;
257257

258-
#ifdef HAVE_STDARG_PROTOTYPES
259258
va_start(vargs, altmsg);
260-
#else
261-
va_start(vargs);
262-
#endif
263259
if (!errcode) {
264260
if (altmsg == NULL) {
265261
PyErr_SetString(exc, "no reason supplied");

Objects/bytesobject.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,7 @@ PyBytes_FromFormat(const char *format, ...)
377377
PyObject* ret;
378378
va_list vargs;
379379

380-
#ifdef HAVE_STDARG_PROTOTYPES
381380
va_start(vargs, format);
382-
#else
383-
va_start(vargs);
384-
#endif
385381
ret = PyBytes_FromFormatV(format, vargs);
386382
va_end(vargs);
387383
return ret;

Objects/exceptions.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,11 +3816,7 @@ _PyErr_TrySetFromCause(const char *format, ...)
38163816
Py_DECREF(tb);
38173817
}
38183818

3819-
#ifdef HAVE_STDARG_PROTOTYPES
38203819
va_start(vargs, format);
3821-
#else
3822-
va_start(vargs);
3823-
#endif
38243820
msg_prefix = PyUnicode_FromFormatV(format, vargs);
38253821
va_end(vargs);
38263822
if (msg_prefix == NULL) {

Objects/unicodeobject.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,11 +2708,7 @@ PyUnicode_FromFormat(const char *format, ...)
27082708
PyObject* ret;
27092709
va_list vargs;
27102710

2711-
#ifdef HAVE_STDARG_PROTOTYPES
27122711
va_start(vargs, format);
2713-
#else
2714-
va_start(vargs);
2715-
#endif
27162712
ret = PyUnicode_FromFormatV(format, vargs);
27172713
va_end(vargs);
27182714
return ret;

PC/pyconfig.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
569569
/* Define to 1 if you have the <signal.h> header file. */
570570
#define HAVE_SIGNAL_H 1
571571

572-
/* Define if you have the <stdarg.h> prototypes. */
573-
#define HAVE_STDARG_PROTOTYPES
574-
575572
/* Define if you have the <stddef.h> header file. */
576573
#define HAVE_STDDEF_H 1
577574

Parser/tokenizer.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,11 +1105,7 @@ static int
11051105
syntaxerror(struct tok_state *tok, const char *format, ...)
11061106
{
11071107
va_list vargs;
1108-
#ifdef HAVE_STDARG_PROTOTYPES
11091108
va_start(vargs, format);
1110-
#else
1111-
va_start(vargs);
1112-
#endif
11131109
int ret = _syntaxerror_range(tok, format, -1, -1, vargs);
11141110
va_end(vargs);
11151111
return ret;
@@ -1121,11 +1117,7 @@ syntaxerror_known_range(struct tok_state *tok,
11211117
const char *format, ...)
11221118
{
11231119
va_list vargs;
1124-
#ifdef HAVE_STDARG_PROTOTYPES
11251120
va_start(vargs, format);
1126-
#else
1127-
va_start(vargs);
1128-
#endif
11291121
int ret = _syntaxerror_range(tok, format, col_offset, end_col_offset, vargs);
11301122
va_end(vargs);
11311123
return ret;
@@ -1146,11 +1138,7 @@ parser_warn(struct tok_state *tok, PyObject *category, const char *format, ...)
11461138
{
11471139
PyObject *errmsg;
11481140
va_list vargs;
1149-
#ifdef HAVE_STDARG_PROTOTYPES
11501141
va_start(vargs, format);
1151-
#else
1152-
va_start(vargs);
1153-
#endif
11541142
errmsg = PyUnicode_FromFormatV(format, vargs);
11551143
va_end(vargs);
11561144
if (!errmsg) {

Python/_warnings.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,11 +1136,7 @@ PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level,
11361136
int res;
11371137
va_list vargs;
11381138

1139-
#ifdef HAVE_STDARG_PROTOTYPES
11401139
va_start(vargs, format);
1141-
#else
1142-
va_start(vargs);
1143-
#endif
11441140
res = _PyErr_WarnFormatV(NULL, category, stack_level, format, vargs);
11451141
va_end(vargs);
11461142
return res;
@@ -1153,11 +1149,7 @@ _PyErr_WarnFormat(PyObject *source, PyObject *category, Py_ssize_t stack_level,
11531149
int res;
11541150
va_list vargs;
11551151

1156-
#ifdef HAVE_STDARG_PROTOTYPES
11571152
va_start(vargs, format);
1158-
#else
1159-
va_start(vargs);
1160-
#endif
11611153
res = _PyErr_WarnFormatV(source, category, stack_level, format, vargs);
11621154
va_end(vargs);
11631155
return res;
@@ -1170,11 +1162,7 @@ PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level,
11701162
int res;
11711163
va_list vargs;
11721164

1173-
#ifdef HAVE_STDARG_PROTOTYPES
11741165
va_start(vargs, format);
1175-
#else
1176-
va_start(vargs);
1177-
#endif
11781166
res = _PyErr_WarnFormatV(source, PyExc_ResourceWarning,
11791167
stack_level, format, vargs);
11801168
va_end(vargs);
@@ -1274,11 +1262,7 @@ PyErr_WarnExplicitFormat(PyObject *category,
12741262
goto exit;
12751263
}
12761264

1277-
#ifdef HAVE_STDARG_PROTOTYPES
12781265
va_start(vargs, format);
1279-
#else
1280-
va_start(vargs);
1281-
#endif
12821266
message = PyUnicode_FromFormatV(format, vargs);
12831267
if (message != NULL) {
12841268
PyObject *res;

Python/compile.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6094,11 +6094,7 @@ static int
60946094
compiler_error(struct compiler *c, const char *format, ...)
60956095
{
60966096
va_list vargs;
6097-
#ifdef HAVE_STDARG_PROTOTYPES
60986097
va_start(vargs, format);
6099-
#else
6100-
va_start(vargs);
6101-
#endif
61026098
PyObject *msg = PyUnicode_FromFormatV(format, vargs);
61036099
va_end(vargs);
61046100
if (msg == NULL) {
@@ -6131,11 +6127,7 @@ static int
61316127
compiler_warn(struct compiler *c, const char *format, ...)
61326128
{
61336129
va_list vargs;
6134-
#ifdef HAVE_STDARG_PROTOTYPES
61356130
va_start(vargs, format);
6136-
#else
6137-
va_start(vargs);
6138-
#endif
61396131
PyObject *msg = PyUnicode_FromFormatV(format, vargs);
61406132
va_end(vargs);
61416133
if (msg == NULL) {

Python/errors.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,7 @@ _PyErr_FormatFromCauseTstate(PyThreadState *tstate, PyObject *exception,
688688
const char *format, ...)
689689
{
690690
va_list vargs;
691-
#ifdef HAVE_STDARG_PROTOTYPES
692691
va_start(vargs, format);
693-
#else
694-
va_start(vargs);
695-
#endif
696692
_PyErr_FormatVFromCause(tstate, exception, format, vargs);
697693
va_end(vargs);
698694
return NULL;
@@ -703,11 +699,7 @@ _PyErr_FormatFromCause(PyObject *exception, const char *format, ...)
703699
{
704700
PyThreadState *tstate = _PyThreadState_GET();
705701
va_list vargs;
706-
#ifdef HAVE_STDARG_PROTOTYPES
707702
va_start(vargs, format);
708-
#else
709-
va_start(vargs);
710-
#endif
711703
_PyErr_FormatVFromCause(tstate, exception, format, vargs);
712704
va_end(vargs);
713705
return NULL;
@@ -1096,11 +1088,7 @@ _PyErr_Format(PyThreadState *tstate, PyObject *exception,
10961088
const char *format, ...)
10971089
{
10981090
va_list vargs;
1099-
#ifdef HAVE_STDARG_PROTOTYPES
11001091
va_start(vargs, format);
1101-
#else
1102-
va_start(vargs);
1103-
#endif
11041092
_PyErr_FormatV(tstate, exception, format, vargs);
11051093
va_end(vargs);
11061094
return NULL;
@@ -1112,11 +1100,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
11121100
{
11131101
PyThreadState *tstate = _PyThreadState_GET();
11141102
va_list vargs;
1115-
#ifdef HAVE_STDARG_PROTOTYPES
11161103
va_start(vargs, format);
1117-
#else
1118-
va_start(vargs);
1119-
#endif
11201104
_PyErr_FormatV(tstate, exception, format, vargs);
11211105
va_end(vargs);
11221106
return NULL;

Python/getargs.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,11 +2792,7 @@ PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t m
27922792
stack = _PyTuple_ITEMS(args);
27932793
nargs = PyTuple_GET_SIZE(args);
27942794

2795-
#ifdef HAVE_STDARG_PROTOTYPES
27962795
va_start(vargs, max);
2797-
#else
2798-
va_start(vargs);
2799-
#endif
28002796
retval = unpack_stack(stack, nargs, name, min, max, vargs);
28012797
va_end(vargs);
28022798
return retval;
@@ -2809,11 +2805,7 @@ _PyArg_UnpackStack(PyObject *const *args, Py_ssize_t nargs, const char *name,
28092805
int retval;
28102806
va_list vargs;
28112807

2812-
#ifdef HAVE_STDARG_PROTOTYPES
28132808
va_start(vargs, max);
2814-
#else
2815-
va_start(vargs);
2816-
#endif
28172809
retval = unpack_stack(args, nargs, name, min, max, vargs);
28182810
va_end(vargs);
28192811
return retval;

Python/hamt.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,7 @@ _hamt_dump_format(_PyUnicodeWriter *writer, const char *format, ...)
496496
int ret;
497497

498498
va_list vargs;
499-
#ifdef HAVE_STDARG_PROTOTYPES
500499
va_start(vargs, format);
501-
#else
502-
va_start(vargs);
503-
#endif
504500
msg = PyUnicode_FromFormatV(format, vargs);
505501
va_end(vargs);
506502

Python/pylifecycle.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,11 +2838,7 @@ _Py_FatalErrorFormat(const char *func, const char *format, ...)
28382838
}
28392839

28402840
va_list vargs;
2841-
#ifdef HAVE_STDARG_PROTOTYPES
28422841
va_start(vargs, format);
2843-
#else
2844-
va_start(vargs);
2845-
#endif
28462842
vfprintf(stream, format, vargs);
28472843
va_end(vargs);
28482844

Python/sysmodule.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,7 @@ _PySys_Audit(PyThreadState *tstate, const char *event,
292292
const char *argFormat, ...)
293293
{
294294
va_list vargs;
295-
#ifdef HAVE_STDARG_PROTOTYPES
296295
va_start(vargs, argFormat);
297-
#else
298-
va_start(vargs);
299-
#endif
300296
int res = sys_audit_tstate(tstate, event, argFormat, vargs);
301297
va_end(vargs);
302298
return res;
@@ -307,11 +303,7 @@ PySys_Audit(const char *event, const char *argFormat, ...)
307303
{
308304
PyThreadState *tstate = _PyThreadState_GET();
309305
va_list vargs;
310-
#ifdef HAVE_STDARG_PROTOTYPES
311306
va_start(vargs, argFormat);
312-
#else
313-
va_start(vargs);
314-
#endif
315307
int res = sys_audit_tstate(tstate, event, argFormat, vargs);
316308
va_end(vargs);
317309
return res;

configure

Lines changed: 0 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0