Skip to content

bpo-41819: Fix "warning: format specifies type wint_t (aka int)" #22332

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
Sep 21, 2020

Conversation

SamuelMarks
Copy link
Contributor

@SamuelMarks SamuelMarks commented Sep 21, 2020

…ut the argument has type `unsigned int`" (pythonGH-)
@vstinner
Copy link
Member

Oh, nicely spotted. I recently tried to fix other compiler warnings:

commit 640e8e1d5f61d5868453d992da04bf4741327748
Author: Victor Stinner <vstinner@python.org>
Date:   Wed Sep 9 12:07:17 2020 +0200

    Fix compiler warnings in init_dump_ascii_wstr() (GH-22150)
    
    Fix GCC 9.3 (using -O3) warnings on x86:
    
    initconfig.c: In function ‘init_dump_ascii_wstr’:
    initconfig.c:2679:34: warning: format ‘%lc’ expects argument of type
    ‘wint_t’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
     2679 |             PySys_WriteStderr("%lc", ch);
    initconfig.c:2682:38: warning: format ‘%x’ expects argument of type
    ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
     2682 |             PySys_WriteStderr("\\x%02x", ch);
    initconfig.c:2686:38: warning: format ‘%x’ expects argument of type
    ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
     2686 |             PySys_WriteStderr("\\U%08x", ch);
    initconfig.c:2690:38: warning: format ‘%x’ expects argument of type
    ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
     2690 |             PySys_WriteStderr("\\u%04x", ch);

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vstinner vstinner merged commit c322948 into python:master Sep 21, 2020
@miss-islington
Copy link
Contributor

Thanks @SamuelMarks for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2020
…2332)

Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948)

Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
@bedevere-bot
Copy link

GH-22334 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Sep 21, 2020
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2020
…2332)

Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948)

Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
@bedevere-bot
Copy link

GH-22335 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Sep 21, 2020
Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948)

Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL7 3.9 has failed when building commit 7aa534c.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/284/builds/43) and take a look at the build logs.
  4. Check if the failure is related to this commit (7aa534c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/284/builds/43

Failed tests:

  • test_asyncio

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 1        
remote: Enumerating objects: 4, done.        
remote: Counting objects:  25% (1/4)        
remote: Counting objects:  50% (2/4)        
remote: Counting objects:  75% (3/4)        
remote: Counting objects: 100% (4/4)        
remote: Counting objects: 100% (4/4), done.        
remote: Total 4 (delta 3), reused 3 (delta 3), pack-reused 0        
From https://github.com/python/cpython
 * branch            3.9        -> FETCH_HEAD
Reset branch '3.9'

test_winsound skipped -- No module named 'winsound'
test_tix skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_winconsoleio skipped -- test only relevant on win32
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_startfile skipped -- object <module 'os' from '/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/os.py'> has no attribute 'startfile'
test_ttk_guionly skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
<string>:2: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
test_ioctl skipped -- Unable to open /dev/tty
test_gdb skipped -- Couldn't find gdb on the path
test_flock (__main__.FNTLEINTRTest) ... ok
test_lockf (__main__.FNTLEINTRTest) ... ok
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll'
test_epoll (__main__.SelectEINTRTest) ... ok
test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue'
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok

----------------------------------------------------------------------
Ran 24 tests in 7.044s

OK (skipped=2)
test_devpoll skipped -- test works only on Solaris OS family
test_kqueue skipped -- test works only on BSD
test_ossaudiodev skipped -- [Errno 2] No such file or directory: '/dev/dsp'
test_msilib skipped -- No module named '_msi'
test_winreg skipped -- No module named 'winreg'
test_tk skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
Timeout (0:15:00)!
Thread 0x00007f1593925740 (most recent call first):
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/selectors.py", line 469 in select
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 1854 in _run_once
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 596 in run_forever
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 629 in run_until_complete
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 441 in test_cancel_make_subprocess_transport_exec
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 550 in _callTestMethod
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 593 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 653 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/runner.py", line 176 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/support/__init__.py", line 1796 in _run_suite
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/support/__init__.py", line 1918 in run_unittest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 140 in _runtest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 193 in runtest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 658 in _main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 638 in main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 716 in main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/regrtest.py", line 43 in _main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/regrtest.py", line 47 in <module>
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/runpy.py", line 87 in _run_code
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/runpy.py", line 197 in _run_module_as_main
Timeout (0:15:00)!
Thread 0x00007f31f4aa3740 (most recent call first):
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/selectors.py", line 469 in select
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 1854 in _run_once
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 596 in run_forever
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 629 in run_until_complete
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 441 in test_cancel_make_subprocess_transport_exec
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 550 in _callTestMethod
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 593 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/case.py", line 653 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/unittest/runner.py", line 176 in run
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/support/__init__.py", line 1796 in _run_suite
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/support/__init__.py", line 1918 in run_unittest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 153 in _runtest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/runtest.py", line 193 in runtest
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 695 in _main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 638 in main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/libregrtest/main.py", line 716 in main
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/test/__main__.py", line 2 in <module>
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/runpy.py", line 87 in _run_code
  File "/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/Lib/runpy.py", line 197 in _run_module_as_main
make: *** [buildbottest] Error 1

Cannot open file '/home/buildbot/buildarea/3.9.cstratak-RHEL7-x86_64/build/test-results.xml' for upload

ambv pushed a commit to ambv/cpython that referenced this pull request Oct 4, 2020
…2332)

Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948)

Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
…2332)

Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
methane pushed a commit that referenced this pull request Oct 21, 2020
Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948)

Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
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.

5 participants