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

enable extra compilation warnings #66308

Closed
neologix mannequin opened this issue Jul 30, 2014 · 10 comments
Closed

enable extra compilation warnings #66308

neologix mannequin opened this issue Jul 30, 2014 · 10 comments
Labels
build The build process and cross-build type-feature A feature request or enhancement

Comments

@neologix
Copy link
Mannequin

neologix mannequin commented Jul 30, 2014

BPO 22110
Nosy @pitrou, @vstinner, @ned-deily, @ezio-melotti
Files
  • extra_warnings.diff
  • 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 2014-08-01.21:37:10.755>
    created_at = <Date 2014-07-30.21:51:40.987>
    labels = ['type-feature', 'build']
    title = 'enable extra compilation warnings'
    updated_at = <Date 2016-03-08.06:05:53.351>
    user = 'https://bugs.python.org/neologix'

    bugs.python.org fields:

    activity = <Date 2016-03-08.06:05:53.351>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-08-01.21:37:10.755>
    closer = 'neologix'
    components = ['Build']
    creation = <Date 2014-07-30.21:51:40.987>
    creator = 'neologix'
    dependencies = []
    files = ['36169']
    hgrepos = []
    issue_num = 22110
    keywords = ['patch']
    message_count = 10.0
    messages = ['224349', '224354', '224359', '224366', '224431', '224445', '224519', '224523', '224602', '261326']
    nosy_count = 7.0
    nosy_names = ['pitrou', 'vstinner', 'ned.deily', 'ezio.melotti', 'Arfrever', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22110'
    versions = ['Python 3.5']

    @neologix
    Copy link
    Mannequin Author

    neologix mannequin commented Jul 30, 2014

    The patch attached enables -Wsign-compare and -Wunreachable-code if supported by the compiler.
    AFAICT, mixed sign comparison warning is automatically enabled by Microsoft's compiler, and is usually a good thing.
    It does add some warnings though.

    As for unreachable code, it's also usually a good thing, since it can be a source of bugs. Note that it's not enabled in debug mode, since in debug mode the code paths aren't the same.

    @neologix neologix mannequin added build The build process and cross-build type-feature A feature request or enhancement labels Jul 30, 2014
    @pitrou
    Copy link
    Member

    pitrou commented Jul 30, 2014

    +1 from me.

    @vstinner
    Copy link
    Member

    The patch adds a a lot of new warnings. Would it be possible to fix them before applying the patch?

    @pitrou
    Copy link
    Member

    pitrou commented Jul 31, 2014

    Enabling the warnings may be a good incitation for other people to fix them ;)

    @neologix
    Copy link
    Mannequin Author

    neologix mannequin commented Jul 31, 2014

    Antoine Pitrou added the comment:

    Enabling the warnings may be a good incitation for other people to fix them ;)

    That was my intention...

    Can I push it, and let warnings be fixed on a case-by-case basis?

    @pitrou
    Copy link
    Member

    pitrou commented Jul 31, 2014

    Le 31/07/2014 13:51, Charles-François Natali a écrit :

    >
    > Enabling the warnings may be a good incitation for other people to fix them ;)

    That was my intention...

    Can I push it, and let warnings be fixed on a case-by-case basis?

    +1 from me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 1, 2014

    New changeset 2c70897e5f98 by Charles-François Natali in branch 'default':
    Issue bpo-22110: Enable extra compilation warnings.
    http://hg.python.org/cpython/rev/2c70897e5f98

    @neologix
    Copy link
    Mannequin Author

    neologix mannequin commented Aug 1, 2014

    Committed.
    Sorry for the extra ~70 warnings :-)

    @neologix neologix mannequin closed this as completed Aug 1, 2014
    @Arfrever
    Copy link
    Mannequin

    Arfrever mannequin commented Aug 3, 2014

    GCC >=4.5.0 (released on 2010-04-14) silently accepts and ignores -Wunreachable-code option. I think that build system of Python should not pass unused options to compiler.

    @ned-deily
    Copy link
    Member

    See Issue bpo-24324 which modifies configure to not use -Wunreachable-code with gcc for the reasons stated there and by Arfrever above.

    @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
    build The build process and cross-build type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants