Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132314: fix stack array init warning#132376

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dura0ok wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromdura0ok:gh-132314
Open
Show file tree
Hide file tree
Changes fromall 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
17 changes: 17 additions & 0 deletionsInclude/pymacro.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,4 +199,21 @@ PyAPI_FUNC(uint32_t) Py_PACK_VERSION(int x, int y);
#endif // Py_LIMITED_API < 3.14


#if defined(__clang__)
#define DISABLE_UNINIT_WARNINGS _Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wuninitialized\"")
#define ENABLE_UNINIT_WARNINGS _Pragma("clang diagnostic pop")
#elif defined(__GNUC__) || defined(__GNUG__)
#define DISABLE_UNINIT_WARNINGS _Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
#define ENABLE_UNINIT_WARNINGS _Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define DISABLE_UNINIT_WARNINGS __pragma(warning(push)) \
__pragma(warning(disable: 4700))
#define ENABLE_UNINIT_WARNINGS __pragma(warning(pop))
#else
#define DISABLE_UNINIT_WARNINGS
#define ENABLE_UNINIT_WARNINGS
#endif

#endif /* Py_PYMACRO_H */
2 changes: 2 additions & 0 deletionsPython/ceval.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1814,6 +1814,7 @@ _PyEvalFramePushAndInit_Ex(PyThreadState *tstate, _PyStackRef func,
PyObject *kwnames = NULL;
_PyStackRef *newargs;
PyObject *const *object_array = NULL;
DISABLE_UNINIT_WARNINGS
_PyStackRef stack_array[8];
if (has_dict) {
object_array = _PyStack_UnpackDict(tstate, _PyTuple_ITEMS(callargs), nargs, kwargs, &kwnames);
Expand DownExpand Up@@ -1855,6 +1856,7 @@ _PyEvalFramePushAndInit_Ex(PyThreadState *tstate, _PyStackRef func,
else if (nargs > 8) {
PyMem_Free((void *)newargs);
}
ENABLE_UNINIT_WARNINGS
/* No need to decref func here because the reference has been stolen by
_PyEvalFramePushAndInit.
*/
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp