Skip to content

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

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2025

Conversation

chris-eibl
Copy link
Member

@chris-eibl chris-eibl commented Mar 15, 2025

This line

PyTime_t ns = 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_t ns = (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:main Mar 15, 2025
49 checks passed
@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]
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants