GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — -Wimplicit-fallthrough generating warnings · Issue #121040 · python/cpython

-Wimplicit-fallthrough generating warnings #121040

New issue
Copy link
New issue
Copy link
Closed
Closed
-Wimplicit-fallthrough generating warnings#121040
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@nohlson
nohlson
opened on Jun 26, 2024
Issue body actions

Bug report

Bug description:

Due to the addition of -Wimplicit-fallthrough as a BASEFLAG new warnings are generated.

This should be reverted until tooling is created to track these new warnings per #112301

Warnings can be found in builds https://buildbot.python.org/all/#/builders/721/builds/1465/steps/3/logs/warnings__143_ from #121030

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-121040: Remove fallthrough warnings compiler option #121041
  • gh-121040: Use __attribute__((fallthrough)) #121044

Activity

  1. nohlson
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 26, 2024
  2. corona10
    added a commit that references this issue on Jun 26, 2024

    gh-121040: Remove fallthrough warnings compiler option (gh-121041)

    ef28f6d
  3. sobolevn commented on Jun 26, 2024

    @sobolevn
    sobolevn
    on Jun 26, 2024
    Member
    More actions

    A potential fix could look something like:

    #if __has_attribute(__fallthrough__)
    #  define _Py_FALLTHROUGH __attribute__((__fallthrough__))
    #else
    #  define _Py_FALLTHROUGH do { } while (0)
    #endif
  4. vstinner
    added 2 commits that reference this issue on Jun 26, 2024

    pythongh-121040: Use __attribute__((fallthrough))

    89ca8fd

    pythongh-121040: Use __attribute__((fallthrough))

    bb2eb56
  5. vstinner commented on Jun 26, 2024

    @vstinner
    vstinner
    on Jun 26, 2024
    Member
    More actions

    Previous issues:

    • Add -Wimplicit-fallthrough=0 to Makefile ? #75106
    • gcc 7 fallthrough warnings #75200
  6. vstinner commented on Jun 26, 2024

    @vstinner
    vstinner
    on Jun 26, 2024
    Member
    More actions

    A potential fix could look something like: (...)

    I wrote PR gh-121044 to fix these compiler warnings; the PR adds a new _Py_FALLTHROUGH macro.

  7. corona10 commented on Jun 26, 2024

    @corona10
    corona10
    on Jun 26, 2024
    Member
    More actions

    A potential fix could look something like:

    It can not be the ultimate solution.

    • Should check MSVC is accept this macro. (or do nothing if the compiler is MSVC)
    • Even if we added the macro for our codebase, vendored libraries like libexpat should follow the new compiler rule.
  8. vstinner commented on Jun 26, 2024

    @vstinner
    vstinner
    on Jun 26, 2024
    Member
    More actions

    Should check MSVC is accept this macro. (or do nothing if the compiler is MSVC)

    Does MSC implement a flag like -Wimplicit-fallthrough? If not, I don't think that we should care about MSC in _Py_FALLTHROUGH macro.

    Even if we added the macro for our codebase, vendored libraries like libexpat should follow the new compiler rule.

    If you want to use this compiler flag, you can use system libraries, instead of building embedded copies of libexpat and libmpdecimal.

  9. corona10 commented on Jun 26, 2024

    @corona10
    corona10
    on Jun 26, 2024
    Member
    More actions

    If you want to use this compiler flag, you can use system libraries, instead of building embedded copies of libexpat and libmpdecimal.

    IIUC, the original intention was to adopt that compiler flag as default, not optional.

  10. corona10 commented on Jun 26, 2024

    @corona10
    corona10
    on Jun 26, 2024
    Member
    More actions

    Does MSC implement a flag like -Wimplicit-fallthrough? If not, I don't think that we should care about MSC in _Py_FALLTHROUGH macro.

    But it emits the compiler warning so we should provide dummy macro for the MSVC
    see: https://github.com/python/cpython/pull/121044/files#r1654967484

  11. vstinner commented on Jun 26, 2024

    @vstinner
    vstinner
    on Jun 26, 2024
    Member
    More actions

    But it emits the compiler warning so we should provide dummy macro for the MSVC
    see: https://github.com/python/cpython/pull/121044/files#r1654967484

    You misunderstood the warning. It was only about __has_attribute(). I fixed this issue.

  12. vstinner
    added a commit that references this issue on Jun 27, 2024

    gh-121040: Use __attribute__((fallthrough)) (#121044)

    12af8ec
  13. vstinner commented on Jun 27, 2024

    @vstinner
    vstinner
    on Jun 27, 2024
    Member
    More actions

    Warnings were fixed by 12af8ec. I close the issue.

  14. vstinner
    closed this as completedon Jun 27, 2024
  15. mrahtz
    added 2 commits that reference this issue on Jun 30, 2024

    pythongh-121040: Remove fallthrough warnings compiler option (pythong…

    c8152ac

    pythongh-121040: Use __attribute__((fallthrough)) (python#121044)

    638d523
  16. estyxx
    added 2 commits that reference this issue on Jul 17, 2024

    pythongh-121040: Remove fallthrough warnings compiler option (pythong…

    73a8f4b

    pythongh-121040: Use __attribute__((fallthrough)) (python#121044)

    f1286b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.