Skip to content

Commit 58a1ea2

Browse files
serhiy-storchakalkollar
authored andcommitted
pythongh-138264: Fix gcc 14 compiler warnings (pythonGH-138265)
1 parent 013f3da commit 58a1ea2

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

Include/internal/pycore_stats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
7777
#define RARE_EVENT_INTERP_INC(interp, name) \
7878
do { \
7979
/* saturating add */ \
80-
int val = FT_ATOMIC_LOAD_UINT8_RELAXED(interp->rare_events.name); \
80+
uint8_t val = FT_ATOMIC_LOAD_UINT8_RELAXED(interp->rare_events.name); \
8181
if (val < UINT8_MAX) { \
8282
FT_ATOMIC_STORE_UINT8(interp->rare_events.name, val + 1); \
8383
} \

Lib/test/test_generated_cases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ def test_instruction_size_macro(self):
15721572
frame->instr_ptr = next_instr;
15731573
next_instr += 1;
15741574
INSTRUCTION_STATS(OP);
1575-
frame->return_offset = 1 ;
1575+
frame->return_offset = 1u ;
15761576
DISPATCH();
15771577
}
15781578
"""

Modules/_sre/sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ match_getindex(MatchObject* self, PyObject* index)
23592359
}
23602360

23612361
// Check that i*2 cannot overflow to make static analyzers happy
2362-
assert(i <= SRE_MAXGROUPS);
2362+
assert((size_t)i <= SRE_MAXGROUPS);
23632363
return i;
23642364
}
23652365

Python/executor_cases.c.h

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

Python/generated_cases.c.h

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

Tools/cases_generator/generators_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def instruction_size(self,
470470
"""Replace the INSTRUCTION_SIZE macro with the size of the current instruction."""
471471
if uop.instruction_size is None:
472472
raise analysis_error("The INSTRUCTION_SIZE macro requires uop.instruction_size to be set", tkn)
473-
self.out.emit(f" {uop.instruction_size} ")
473+
self.out.emit(f" {uop.instruction_size}u ")
474474
return True
475475

476476
def _print_storage(self, reason:str, storage: Storage) -> None:

0 commit comments

Comments
 (0)