This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"
Type: behavior Stage: resolved
Components: Build Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: kj, serhiy.storchaka, sobolevn
Priority: normal Keywords: patch

Created on 2021-10-29 09:46 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29307 merged sobolevn, 2021-10-29 09:56
PR 29341 merged sobolevn, 2021-10-31 08:46
Messages (5)
msg405296 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2021-10-29 09:46
Right now GitHub emmits this warning:

```
GitHub Actions / Windows (x64)

Programs/_testembed.c#L1735

'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *' [D:\a\cpython\cpython\PCbuild\_testembed.vcxproj]

```

Example: https://github.com/python/cpython/pull/29272/files#file-programs-_testembed-c-L1735

Source: https://github.com/python/cpython/blob/7bddd96982072d04bd6314da1ee7f40b7f875f00/Programs/_testembed.c#L1736

I will send a PR with the fix.
msg405391 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-10-31 02:14
New changeset aad48062ef8f983fbb95f9dc0c3c3cef9c89df02 by Nikita Sobolev in branch 'main':
bpo-45666: fixes warning with `swprintf` and `%s` (GH-29307)
https://github.com/python/cpython/commit/aad48062ef8f983fbb95f9dc0c3c3cef9c89df02
msg405393 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-31 08:14
From the man page:

       S      (Not in C99 or C11, but in SUSv2, SUSv3, and SUSv4.)  Synonym for ls.  Don't use.
msg405436 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-11-01 12:11
New changeset 401d25e92f62a9ef320a97542b3e63cb8c34e7e9 by Nikita Sobolev in branch 'main':
bpo-45666: Use `%S` for MSVC and `%s` elsewhere for `swprintf` in `_testembed.c` (GH-29341)
https://github.com/python/cpython/commit/401d25e92f62a9ef320a97542b3e63cb8c34e7e9
msg405437 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-11-01 12:14
@Serhiy Thanks for catching my mistake. I'm glad you came across the PR.

And thank you @Nikita for your patience. Closing this issue!
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89829
2021-11-01 12:14:53kjsetstatus: open -> closed
resolution: fixed
messages: + msg405437

stage: patch review -> resolved
2021-11-01 12:11:43kjsetmessages: + msg405436
2021-10-31 08:46:11sobolevnsetpull_requests: + pull_request27608
2021-10-31 08:14:35serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg405393
2021-10-31 02:14:02kjsetnosy: + kj
messages: + msg405391
2021-10-29 09:56:09sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request27576
2021-10-29 09:54:08sobolevnsetcomponents: + Build, - Library (Lib)
2021-10-29 09:46:48sobolevncreate