This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2019年03月05日 14:31 by matrixise, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12179 | merged | matrixise, 2019年03月05日 14:33 | |
| PR 12180 | merged | serhiy.storchaka, 2019年03月05日 15:31 | |
| Messages (7) | |||
|---|---|---|---|
| msg337191 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2019年03月05日 14:31 | |
gcc -pthread -c -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -g -Og -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Objects/memoryobject.o Objects/memoryobject.c Objects/memoryobject.c:3112:21: warning: cast between incompatible function types from 'PyObject * (*)(PyMemoryViewObject *, PyObject *, PyObject *)' {aka 'struct _object * (*)(struct <anonymous> *, struct _object *, struct _object *)'} to 'PyObject * (*)(PyObject *, PyObject *)' {aka 'struct _object * (*)(struct _object *, struct _object *)'} [-Wcast-function-type] {"tobytes", (PyCFunction)memory_tobytes, METH_VARARGS|METH_KEYWORDS, memory_tobytes_doc}, I am preparing a small PR for this issue. |
|||
| msg337195 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2019年03月05日 14:49 | |
Fix an other warning in the same PR _collections._tuplegetter.__reduce__ |
|||
| msg337196 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年03月05日 14:57 | |
I prefer to reuse bpo-33012. |
|||
| msg337208 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年03月05日 15:33 | |
This is not correct fix for tuplegetter_reduce. tuplegetter_reduce should have two parameters, just the second is unused. |
|||
| msg337211 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2019年03月05日 15:41 | |
Hi @serhiy, Thank you for your PR, I prefer your patch, just because you have just added the PyObject *Py_UNUSED(ignored) to the tuplegetter_reduce function. And in this case, you don't need to cast to (void(*)(void)). I will use this tip for the next time. Thank |
|||
| msg337212 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年03月05日 15:45 | |
This is only for methods with METH_NOARGS. The code that calls such method, calls it with two arguments, passing NULL as the second argument. So the signature of the C function should have two parameters. Functions for methods with METH_KEYWORDS or METH_FASTCALL should have different corresponding signatures. |
|||
| msg337226 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年03月05日 16:41 | |
New changeset adfffc7343ce7ebc88ec734a803d3247ba8927fb by Serhiy Storchaka in branch 'master': Fix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180) https://github.com/python/cpython/commit/adfffc7343ce7ebc88ec734a803d3247ba8927fb |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:12 | admin | set | github: 80378 |
| 2019年03月05日 16:41:13 | serhiy.storchaka | set | resolution: duplicate -> fixed messages: + msg337226 |
| 2019年03月05日 15:45:46 | serhiy.storchaka | set | messages: + msg337212 |
| 2019年03月05日 15:41:16 | matrixise | set | messages: + msg337211 |
| 2019年03月05日 15:33:51 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg337208 |
| 2019年03月05日 15:31:53 | serhiy.storchaka | set | pull_requests: + pull_request12176 |
| 2019年03月05日 14:57:52 | vstinner | set | status: open -> closed superseder: Invalid function cast warnings with gcc 8 for METH_NOARGS nosy: + vstinner messages: + msg337196 resolution: duplicate stage: patch review -> resolved |
| 2019年03月05日 14:49:15 | matrixise | set | messages:
+ msg337195 title: Compilation Warning for memoryview.tobytes -> Compilation Warning for memoryview.tobytes and _collections._tuplegetter.__reduce__ |
| 2019年03月05日 14:34:32 | matrixise | set | keywords: + easy (C) |
| 2019年03月05日 14:33:05 | matrixise | set | keywords:
+ patch stage: patch review pull_requests: + pull_request12174 |
| 2019年03月05日 14:31:54 | matrixise | create | |