Skip to content

gh-95065: Argument Clinic: Add comment to preprocessor warning code #107766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions Lib/test/clinic.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5524,6 +5524,7 @@ test_deprecate_positional_pos1_len1_optional(PyObject *module, PyObject *const *
PyObject *a;
PyObject *b = Py_None;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'b' in the clinic input of" \
Expand Down Expand Up @@ -5571,7 +5572,7 @@ test_deprecate_positional_pos1_len1_optional(PyObject *module, PyObject *const *
static PyObject *
test_deprecate_positional_pos1_len1_optional_impl(PyObject *module,
PyObject *a, PyObject *b)
/*[clinic end generated code: output=6c0fd9d94fa1e765 input=89099f3dacd757da]*/
/*[clinic end generated code: output=144cbf1adc574dd9 input=89099f3dacd757da]*/


/*[clinic input]
Expand Down Expand Up @@ -5630,6 +5631,7 @@ test_deprecate_positional_pos1_len1(PyObject *module, PyObject *const *args, Py_
PyObject *a;
PyObject *b;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'b' in the clinic input of" \
Expand Down Expand Up @@ -5669,7 +5671,7 @@ test_deprecate_positional_pos1_len1(PyObject *module, PyObject *const *args, Py_
static PyObject *
test_deprecate_positional_pos1_len1_impl(PyObject *module, PyObject *a,
PyObject *b)
/*[clinic end generated code: output=22821a0fa9945d0c input=1702bbab1e9b3b99]*/
/*[clinic end generated code: output=994bd57c1c634709 input=1702bbab1e9b3b99]*/


/*[clinic input]
Expand Down Expand Up @@ -5735,6 +5737,7 @@ test_deprecate_positional_pos1_len2_with_kwd(PyObject *module, PyObject *const *
PyObject *c;
PyObject *d;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'b' and 'c' in the clinic " \
Expand Down Expand Up @@ -5781,7 +5784,7 @@ static PyObject *
test_deprecate_positional_pos1_len2_with_kwd_impl(PyObject *module,
PyObject *a, PyObject *b,
PyObject *c, PyObject *d)
/*[clinic end generated code: output=061d554ccc6b8f51 input=28cdb885f6c34eab]*/
/*[clinic end generated code: output=146c60ecbcdbf4b8 input=28cdb885f6c34eab]*/


/*[clinic input]
Expand Down Expand Up @@ -5837,6 +5840,7 @@ test_deprecate_positional_pos0_len1(PyObject *module, PyObject *const *args, Py_
PyObject *argsbuf[1];
PyObject *a;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'a' in the clinic input of" \
Expand Down Expand Up @@ -5874,7 +5878,7 @@ test_deprecate_positional_pos0_len1(PyObject *module, PyObject *const *args, Py_

static PyObject *
test_deprecate_positional_pos0_len1_impl(PyObject *module, PyObject *a)
/*[clinic end generated code: output=3e512117a5eda970 input=678206db25c0652c]*/
/*[clinic end generated code: output=dce99971a2494f9f input=678206db25c0652c]*/


/*[clinic input]
Expand Down Expand Up @@ -5933,6 +5937,7 @@ test_deprecate_positional_pos0_len2(PyObject *module, PyObject *const *args, Py_
PyObject *a;
PyObject *b;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'a' and 'b' in the clinic " \
Expand Down Expand Up @@ -5975,7 +5980,7 @@ test_deprecate_positional_pos0_len2(PyObject *module, PyObject *const *args, Py_
static PyObject *
test_deprecate_positional_pos0_len2_impl(PyObject *module, PyObject *a,
PyObject *b)
/*[clinic end generated code: output=d41da050a5b82dd0 input=fae0d0b1d480c939]*/
/*[clinic end generated code: output=06999692e0c8dac4 input=fae0d0b1d480c939]*/


/*[clinic input]
Expand Down Expand Up @@ -6044,6 +6049,7 @@ test_deprecate_positional_pos0_len3_with_kwdonly(PyObject *module, PyObject *con
PyObject *c;
PyObject *e;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'a', 'b' and 'c' in the " \
Expand Down Expand Up @@ -6095,7 +6101,7 @@ test_deprecate_positional_pos0_len3_with_kwdonly_impl(PyObject *module,
PyObject *b,
PyObject *c,
PyObject *e)
/*[clinic end generated code: output=c5d7ddfc139ddf31 input=1b0121770c0c52e0]*/
/*[clinic end generated code: output=a553e33101dc42b2 input=1b0121770c0c52e0]*/


/*[clinic input]
Expand Down Expand Up @@ -6156,6 +6162,7 @@ test_deprecate_positional_pos2_len1(PyObject *module, PyObject *const *args, Py_
PyObject *b;
PyObject *c;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'c' in the clinic input of" \
Expand Down Expand Up @@ -6196,7 +6203,7 @@ test_deprecate_positional_pos2_len1(PyObject *module, PyObject *const *args, Py_
static PyObject *
test_deprecate_positional_pos2_len1_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c)
/*[clinic end generated code: output=d80609e6b37ffb8a input=e1d129689e69ec7c]*/
/*[clinic end generated code: output=f96454a4970b443c input=e1d129689e69ec7c]*/


/*[clinic input]
Expand Down Expand Up @@ -6260,6 +6267,7 @@ test_deprecate_positional_pos2_len2(PyObject *module, PyObject *const *args, Py_
PyObject *c;
PyObject *d;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'c' and 'd' in the clinic " \
Expand Down Expand Up @@ -6305,7 +6313,7 @@ static PyObject *
test_deprecate_positional_pos2_len2_impl(PyObject *module, PyObject *a,
PyObject *b, PyObject *c,
PyObject *d)
/*[clinic end generated code: output=1c10d6197562319f input=0d53533463a12792]*/
/*[clinic end generated code: output=5e648e887da0a804 input=0d53533463a12792]*/


/*[clinic input]
Expand Down Expand Up @@ -6377,6 +6385,7 @@ test_deprecate_positional_pos2_len3_with_kwdonly(PyObject *module, PyObject *con
PyObject *d;
PyObject *e;

// Emit compiler warnings when we get to Python 3.14.
#if PY_VERSION_HEX >= 0x030e00C0
# error \
"In clinic.test.c, update parameter(s) 'c' and 'd' in the clinic " \
Expand Down Expand Up @@ -6427,4 +6436,4 @@ test_deprecate_positional_pos2_len3_with_kwdonly_impl(PyObject *module,
PyObject *c,
PyObject *d,
PyObject *e)
/*[clinic end generated code: output=d32375ffce63d3db input=154fd450448d8935]*/
/*[clinic end generated code: output=383d56b03f7c2dcb input=154fd450448d8935]*/
1 change: 1 addition & 0 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ class CLanguage(Language):
#endif /* !defined({methoddef_name}) */
""")
DEPRECATED_POSITIONAL_PROTOTYPE: Final[str] = r"""
// Emit compiler warnings when we get to Python {major}.{minor}.
#if PY_VERSION_HEX >= 0x{major:02x}{minor:02x}00C0
# error \
{cpp_message}
Expand Down