Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Attempt to silence c-analyzer
(Why can't I run this locally on macOS?)
  • Loading branch information
gvanrossum committed Jun 28, 2023
commit 9e35908e77512338843821ab7b1db544835b8c92
4 changes: 2 additions & 2 deletions Python/opcode_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ struct opcode_macro_expansion {
extern const struct opcode_metadata _PyOpcode_opcode_metadata[512];
extern const struct opcode_macro_expansion _PyOpcode_macro_expansion[256];
#ifdef Py_DEBUG
extern const char *_PyOpcode_uop_name[512];
extern const char * const _PyOpcode_uop_name[512];
#endif
#else
const struct opcode_metadata _PyOpcode_opcode_metadata[512] = {
Expand Down Expand Up @@ -1222,7 +1222,7 @@ const struct opcode_macro_expansion _PyOpcode_macro_expansion[256] = {
[SWAP] = { .nuops = 1, .uops = { { SWAP, 0, 0 } } },
};
#ifdef Py_DEBUG
const char *_PyOpcode_uop_name[512] = {
const char * const _PyOpcode_uop_name[512] = {
[300] = "EXIT_TRACE",
[301] = "SET_IP",
[302] = "_GUARD_BOTH_INT",
Expand Down
4 changes: 2 additions & 2 deletions Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ def write_metadata(self) -> None:
self.out.emit("extern const struct opcode_metadata _PyOpcode_opcode_metadata[512];")
self.out.emit("extern const struct opcode_macro_expansion _PyOpcode_macro_expansion[256];")
self.out.emit("#ifdef Py_DEBUG")
self.out.emit("extern const char *_PyOpcode_uop_name[512];")
self.out.emit("extern const char * const _PyOpcode_uop_name[512];")
self.out.emit("#endif")
self.out.emit("#else")

Expand Down Expand Up @@ -1268,7 +1268,7 @@ def write_metadata(self) -> None:
typing.assert_never(thing)

self.out.emit("#ifdef Py_DEBUG")
with self.out.block("const char *_PyOpcode_uop_name[512] =", ";"):
with self.out.block("const char * const _PyOpcode_uop_name[512] =", ";"):
self.write_uop_items(lambda name, counter: f"[{counter}] = \"{name}\",")
self.out.emit("#endif")

Expand Down