Skip to content

Remove -Wunreachable-code flag #68512

Closed
Closed

Description

@smontanaro
BPO 24324
Nosy @loewis, @smontanaro, @pitrou, @vstinner, @ned-deily, @embray
Files
  • unreached.diff
  • Python351-no-unreachable-check.diff: Cleaner version of Skip's patch. Just changes configure.ac
  • 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 2016-03-08.06:01:59.710>
    created_at = <Date 2015-05-29.13:51:17.482>
    labels = ['build']
    title = 'Remove -Wunreachable-code flag'
    updated_at = <Date 2016-03-08.06:01:59.706>
    user = 'https://github.com/smontanaro'

    bugs.python.org fields:

    activity = <Date 2016-03-08.06:01:59.706>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-03-08.06:01:59.710>
    closer = 'ned.deily'
    components = ['Build']
    creation = <Date 2015-05-29.13:51:17.482>
    creator = 'skip.montanaro'
    dependencies = []
    files = ['40510', '41663']
    hgrepos = []
    issue_num = 24324
    keywords = ['patch']
    message_count = 8.0
    messages = ['244377', '245035', '251001', '251004', '251017', '261323', '261324', '261325']
    nosy_count = 7.0
    nosy_names = ['loewis', 'skip.montanaro', 'pitrou', 'vstinner', 'ned.deily', 'python-dev', 'erik.bray']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue24324'
    versions = ['Python 3.5', 'Python 3.6']

    Activity

    1. smontanaro commented on May 29, 2015

      @smontanaro
      ContributorAuthor

      Makefile.pre defines BASECFLAGS to include -Wunreachable-code. When building in the Linux environment available to me (GCC 4.4.6), compilation spews tons of warnings about "warning: will never be executed". According to this StackOverflow thread:

      http://stackoverflow.com/questions/14591778/

      that flag was always broken in GCC and was eventually removed in 4.5. Maybe we should dispense with it when building Python, at least unless requested by the user.

    2. smontanaro commented on Jun 8, 2015

      @smontanaro
      ContributorAuthor

      I guess this is an autoconf thing. "@BASECFLAGS@" in Makefile.pre.in seems to expand to "-Wsign-compare -Wunreachable-code" in Makefile.pre.

    3. embray commented on Sep 18, 2015

      @embray
      Contributor

      This would definitely be nice to fix. I panicked a bit because of this when I compiled my extension modules against Python 3.5 for the first time.

    4. vstinner commented on Sep 18, 2015

      @vstinner
      Member

      Can you please propose a patch?

    5. smontanaro commented on Sep 18, 2015

      @smontanaro
      ContributorAuthor

      This seems to work for me. Diff against default. I have no idea how old the autoconf setup is here at work. I imagine you'll want to only apply the configure.ac patch and regenerate configure.

    6. python-dev commented on Mar 8, 2016

      python-devmannequin
      Mannequin

      New changeset 61f8f7610a88 by Ned Deily in branch '3.5':
      Issue bpo-24324: Do not enable unreachable code warnings when using
      https://hg.python.org/cpython/rev/61f8f7610a88

    7. python-dev commented on Mar 8, 2016

      python-devmannequin
      Mannequin

      New changeset 8fecf6e17616 by Ned Deily in branch 'default':
      Issue bpo-24324: merge from 3.5
      https://hg.python.org/cpython/rev/8fecf6e17616

    8. ned-deily commented on Mar 8, 2016

      @ned-deily
      Member

      Thanks for the suggested patches. I used a somewhat different approach in an attempt to retain the benefit of the unreachable code warning when using other (non-GCC) compilers, in particular, llvm clang where the warnings do seem to be useful.

    9. transferred this issue fromon Apr 10, 2022
    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

      buildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions