Skip to content
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

Fix some compiler warnings #85985

Closed
SamuelMarks mannequin opened this issue Sep 20, 2020 · 8 comments
Closed

Fix some compiler warnings #85985

SamuelMarks mannequin opened this issue Sep 20, 2020 · 8 comments
Labels
3.8 only security fixes 3.9 only security fixes build The build process and cross-build

Comments

@SamuelMarks
Copy link
Mannequin

SamuelMarks mannequin commented Sep 20, 2020

BPO 41819
Nosy @vstinner, @methane, @ambv, @miss-islington, @SamuelMarks, @iritkatriel
PRs
  • bpo-41819 [3.9] Fix some compiler warnings #22329
  • bpo-41819: Fix "warning: format specifies type wint_t (aka int)" #22332
  • [3.9] bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332) #22334
  • [3.8] bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332) #22335
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-10-21.08:55:59.326>
    created_at = <Date 2020-09-20.06:10:02.680>
    labels = ['build', '3.8', '3.9']
    title = 'Fix some compiler warnings'
    updated_at = <Date 2020-10-21.08:55:59.325>
    user = 'https://github.com/SamuelMarks'

    bugs.python.org fields:

    activity = <Date 2020-10-21.08:55:59.325>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-21.08:55:59.326>
    closer = 'methane'
    components = ['Build']
    creation = <Date 2020-09-20.06:10:02.680>
    creator = 'samuelmarks'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41819
    keywords = ['patch']
    message_count = 8.0
    messages = ['377205', '377226', '377239', '377243', '377244', '377246', '378055', '379201']
    nosy_count = 6.0
    nosy_names = ['vstinner', 'methane', 'lukasz.langa', 'miss-islington', 'samuelmarks', 'iritkatriel']
    pr_nums = ['22329', '22332', '22334', '22335']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue41819'
    versions = ['Python 3.8', 'Python 3.9']

    @SamuelMarks
    Copy link
    Mannequin Author

    SamuelMarks mannequin commented Sep 20, 2020

    @SamuelMarks SamuelMarks mannequin added 3.9 only security fixes build The build process and cross-build labels Sep 20, 2020
    @iritkatriel
    Copy link
    Member

    Can you give more details about what you're fixing: what were the compiler warnings, which compiler (and which version of the compiler), which system?

    Also, why did you create the PR against the 3.9 branch rather than master?

    @SamuelMarks
    Copy link
    Mannequin Author

    SamuelMarks mannequin commented Sep 21, 2020

    Okay I'll redo it on master, here is my config, on macOS 10.15.6:

    $ export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
    $ export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    $ export LDFLAGS="-L/usr/local/opt/openssl@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@1.1/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@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.

    @vstinner
    Copy link
    Member

    New changeset c322948 by Samuel Marks in branch 'master':
    bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)
    c322948

    @vstinner
    Copy link
    Member

    ./Python/initconfig.c:2677:38: warning: format specifies type 'wint_t' (...)

    Is there the only warning that you want to fix? Can we close the issue? Or are there other remaining warnings?

    @miss-islington
    Copy link
    Contributor

    New changeset 7aa534c by Miss Islington (bot) in branch '3.9':
    bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)
    7aa534c

    @ambv
    Copy link
    Contributor

    ambv commented Oct 5, 2020

    New changeset c549527 by Łukasz Langa (Miss Islington (bot)) in branch '3.9':
    bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)
    c549527

    @methane
    Copy link
    Member

    methane commented Oct 21, 2020

    New changeset c756c2b by Miss Skeleton (bot) in branch '3.8':
    bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)
    c756c2b

    @methane methane added the 3.8 only security fixes label Oct 21, 2020
    @methane methane closed this as completed Oct 21, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants