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

"-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++" #50005

Closed
zooko mannequin opened this issue Apr 14, 2009 · 16 comments
Closed

"-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++" #50005

zooko mannequin opened this issue Apr 14, 2009 · 16 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@zooko
Copy link
Mannequin

zooko mannequin commented Apr 14, 2009

BPO 5755
Nosy @tarekziade, @methane, @serhiy-storchaka, @jdemeyer, @grimreaper, @miss-islington
PRs
  • bpo-5755: remove compiler flag -Wstrict-prototypes #6791
  • bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST #7395
  • [3.7] bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395) #7422
  • [3.6] bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395) #7438
  • [2.7] bpo-5755: don't use compiler flag -Wstrict-prototypes (GH-7395) #7476
  • Files
  • no_strict_proto.patch: Disable -Wstrict-prototypes
  • 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 = 'https://github.com/tarekziade'
    closed_at = <Date 2018-06-06.05:26:45.429>
    created_at = <Date 2009-04-14.17:22:50.629>
    labels = ['library']
    title = '"-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"'
    updated_at = <Date 2018-06-07.10:13:19.160>
    user = 'https://bugs.python.org/zooko'

    bugs.python.org fields:

    activity = <Date 2018-06-07.10:13:19.160>
    actor = 'jdemeyer'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2018-06-06.05:26:45.429>
    closer = 'methane'
    components = ['Distutils']
    creation = <Date 2009-04-14.17:22:50.629>
    creator = 'zooko'
    dependencies = []
    files = ['44464']
    hgrepos = []
    issue_num = 5755
    keywords = ['patch']
    message_count = 16.0
    messages = ['85972', '87130', '116598', '135128', '316519', '316626', '316733', '318644', '318645', '318647', '318648', '318650', '318651', '318737', '318792', '318800']
    nosy_count = 10.0
    nosy_names = ['zooko', 'tarek', 'methane', 'Jason.Grout', 'GooseYArd', 'vokoda', 'serhiy.storchaka', 'jdemeyer', 'eitan.adler', 'miss-islington']
    pr_nums = ['6791', '7395', '7422', '7438', '7476']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue5755'
    versions = []

    @zooko
    Copy link
    Mannequin Author

    zooko mannequin commented Apr 14, 2009

    A user of the Tahoe-LAFS project submitted a bug report to us, saying:

    """
    I get lots of "cc1plus: warning: command line option "-Wstrict-
    prototypes" is valid for Ada/C/ObjC but not for C++" when compiling
    """

    A little googling shows that this gets reported frequently to other
    Python projects that have C++ code:

    http://trac.sagemath.org/sage_trac/ticket/425
    http://www.mail-archive.com/matplotlib-
    users@lists.sourceforge.net/msg03947.html

    Those other projects seem to think that this is distutils's problem, but
    I don't see evidence that any of them opened a ticket for distutils yet.

    @zooko zooko mannequin assigned tarekziade Apr 14, 2009
    @zooko zooko mannequin added the stdlib Python modules in the Lib dir label Apr 14, 2009
    @tarekziade
    Copy link
    Mannequin

    tarekziade mannequin commented May 4, 2009

    I could work on a patch for this, by checking the compiler, if I get
    some feedback from the matplotlib guys in this issue here

    @JasonGrout
    Copy link
    Mannequin

    JasonGrout mannequin commented Sep 16, 2010

    Any progress on this? I see this warning a *lot* when compiling lots of packages for Sage (matplotlib included).

    @vokoda
    Copy link
    Mannequin

    vokoda mannequin commented May 4, 2011

    distutils reuses whatever flags Python was built with, covered here: http://bugs.python.org/issue1222585 (and here http://bugs.python.org/issue9031).

    @serhiy-storchaka
    Copy link
    Member

    Maybe include it in PY_CFLAGS_NODIST instead of PY_CFLAGS? Or just remove it, since in any case we now use -Wall and -Wextra with GCC.

    @jdemeyer
    Copy link
    Contributor

    Or just remove it

    I updated the PR to do that.

    I didn't want to propose that initially because that patch was proposed here almost 2 years ago but not accepted.

    @grimreaper
    Copy link
    Mannequin

    grimreaper mannequin commented May 15, 2018

    copying and adapting my comments on the PR:

    Strict Prototypes is correct and helpful for C. That said, the way it is currently implemented, by checking for the compiler in CC is sub-optimal at best.
    CC ought to always be a C compiler, and never a C++ compiler.
    It also seems questionable that distutils is using the python cflags rather than a dedicated set.

    The best fix is a separate and specific list of flags for distutils rather than modifying the set of flags used to build python. That said, the current implementing of flags for python isn't great, so lets remove it as a short term fix.

    @methane
    Copy link
    Member

    methane commented Jun 4, 2018

    Can we backport this to 3.7 and 3.6? I think it's safe and helpful.

    @serhiy-storchaka
    Copy link
    Member

    I am not sure now about removing -Wstrict-prototypes. I haven't found confirmation that this option is included in -Wall or -Wextra.

    @methane
    Copy link
    Member

    methane commented Jun 4, 2018

    -Wstrict-prototypes is not included in -Wall and -Wextra.
    I created PR-7395 which moves the option to CFLAGS_NODIST, as Serhiy suggested before.

    @jdemeyer
    Copy link
    Contributor

    jdemeyer commented Jun 4, 2018

    Can we backport this to 3.7 and 3.6? I think it's safe and helpful.

    And 2.7 for the same reasons.

    @methane
    Copy link
    Member

    methane commented Jun 4, 2018

    2.7 doesn't have CFLAGS_NODIST and I don't have motivation to manually backport it to 2.7. (I'm not expert of autotools)

    @jdemeyer
    Copy link
    Contributor

    jdemeyer commented Jun 4, 2018

    2.7 doesn't have CFLAGS_NODIST

    I meant backporting this patch as-is to 2.7 without adding -Wstrict-prototypes to CFLAGS_NODIST

    @methane
    Copy link
    Member

    methane commented Jun 5, 2018

    New changeset e336484 by INADA Naoki in branch 'master':
    bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
    e336484

    @miss-islington
    Copy link
    Contributor

    New changeset d6e789c by Miss Islington (bot) in branch '3.7':
    bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
    d6e789c

    @methane
    Copy link
    Member

    methane commented Jun 6, 2018

    New changeset d59f97c by INADA Naoki in branch '3.6':
    bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
    d59f97c

    @methane methane closed this as completed Jun 6, 2018
    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants