Skip to content

GH-131296: fix clang-cl warning on Windows in pytime.c - #131297

Merged
gpshead merged 1 commit into
python:mainfrom
chris-eibl:fix_clangcl_pytime
Mar 15, 2025
Merged

GH-131296: fix clang-cl warning on Windows in pytime.c#131297
gpshead merged 1 commit into
python:mainfrom
chris-eibl:fix_clangcl_pytime

Conversation

@chris-eibl

@chris-eiblchris-eibl commented Mar 15, 2025

Copy link
Copy Markdown
Member

This line

PyTime_tns=large.QuadPart*100-11644473600000000000;

produces

..\Python\pytime.c(918,42): warning : integer literal is too large to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]

Let's convert it to

PyTime_tns= (large.QuadPart-116444736000000000) *100;

which produces no warning but the exact same code: https://godbolt.org/z/r97Yadj5s

I think this is a skip news.

to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]
@gpshead
gpshead merged commit f104c19 into python:mainMar 15, 2025
@chris-eibl
chris-eibl deleted the fix_clangcl_pytime branch March 15, 2025 19:17
plashchynski pushed a commit to plashchynski/cpython that referenced this pull request Mar 17, 2025
…H-131297)
fix warning : integer literal is too large
to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@chris-eibl@gpshead