[issue41819] Fix some compiler warnings

Samuel Marks report at bugs.python.org
Sun Sep 20 22:02:26 EDT 2020


Samuel Marks <samuelmarks at gmail.com> added the comment:

Okay I'll redo it on master, here is my config, on macOS 10.15.6:
```
$ export PKG_CONFIG_PATH="/usr/local/opt/openssl at 1.1/lib/pkgconfig"
$ export CPPFLAGS="-I/usr/local/opt/openssl at 1.1/include"
$ export LDFLAGS="-L/usr/local/opt/openssl at 1.1/lib"
$ export CPPFLAGS="-I/usr/local/opt/zlib/include $CPPFLAGS"
$ export LDFLAGS="-L/usr/local/opt/zlib/lib $LDFLAGS"
$ gcc --version && clang --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ ./configure --enable-optimizations --prefix /opt/python3-master
$ ./configure --enable-optimizations --prefix /opt/python3-master
checking for git... found
checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
[… omitted for brevity]
$ make
```

With these warnings being addressed by this bug report and PR:
```
gcc -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal  -I. -I./Include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl at 1.1/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl at 1.1/include  -DPy_BUILD_CORE \
		-DPLATLIBDIR='"lib"' \
		-o Python/initconfig.o ./Python/initconfig.c
./Python/initconfig.c:2677:38: warning: format specifies type 'wint_t' (aka 'int') but the argument has type 'unsigned int' [-Wformat]
            PySys_WriteStderr("%lc", ch);
                               ~~~   ^~
                               %c
1 warning generated.
```

Looks like someone else has already picked up the other bug. So opened a new PR for this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41819>
_______________________________________


More information about the Python-bugs-list mailing list