-Wstrict-prototypes option should not be added

Hi,

It would be great to be able to compile matplotlib without a warning :slight_smile:
Unfortunately, I was not able to fix this warning performing a simple grep into the sources:
"cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"
It looks like this option is automagically added by the build script in a way I fail to understand reading quickly the sources.
Anyway, there should be a simple solution to avoid this warning (gcc version 4.1.3)...
Any comments?

Xavier

···

--
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles AndrÔŅĹ
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@...419...
############################################

Hi,

Matplotlib uses the distutils facilities to build the extension code. Unfortunately, it is not possible to add or remove compiler flags, distutils uses the same flags as Python when it was built. So this should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419…>:

···

Hi,

It would be great to be able to compile matplotlib without a warning :slight_smile:
Unfortunately, I was not able to fix this warning performing a simple
grep into the sources:
"cc1plus: warning: command line option ‚Äú-Wstrict-prototypes‚ÄĚ is valid

for Ada/C/ObjC but not for C++"
It looks like this option is automagically added by the build script in
a way I fail to understand reading quickly the sources.
Anyway, there should be a simple solution to avoid this warning (gcc

version 4.1.3)…
Any comments?

Xavier

‚Äď
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles André
69561 Saint Genis Laval cedex

Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@…419…
############################################


This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>
http://get.splunk.com/


Matplotlib-users mailing list
Matplotlib-users@…431…ists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi,

Well the point is that matplotlib in writtenin C++ and python is written in C.
The valid gcc options are not the same in C and in C++ so it looks strange (and it is a pity) if distutils do not provide the user with a way to modify these flag in this case.
XAvier

···

Hi,

Matplotlib uses the distutils facilities to build the extension code. Unfortunately, it is not possible to add or remove compiler flags, distutils uses the same flags as Python when it was built. So this should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419… <mailto:gnata@…419…>>:

    Hi,

    It would be great to be able to compile matplotlib without a
    warning :slight_smile:
    Unfortunately, I was not able to fix this warning performing a simple
    grep into the sources:
    "cc1plus: warning: command line option "-Wstrict-prototypes" is valid
    for Ada/C/ObjC but not for C++"
    It looks like this option is automagically added by the build
    script in
    a way I fail to understand reading quickly the sources.
    Anyway, there should be a simple solution to avoid this warning (gcc
    version 4.1.3)...
    Any comments?

    Xavier

¬†¬†¬†¬†‚Äď
    ############################################
    Xavier Gnata
    CRAL - Observatoire de Lyon
¬†¬†¬†¬†9, avenue Charles AndrÔŅĹ
    69561 Saint Genis Laval cedex
    Phone: +33 4 78 86 85 28
    Fax: +33 4 78 86 83 86
    E-mail: gnata@…419… <mailto:gnata@…419…>
    ############################################

    -------------------------------------------------------------------------

    This SF.net email is sponsored by: Splunk Inc.
    Still grepping through log files to find problems? Stop.
    Now Search log events and configuration files using AJAX and a
    browser.
    Download your FREE copy of Splunk now >> http://get.splunk.com/
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles AndrÔŅĹ
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@...419...
############################################

http://deluge-torrent.org/svn/tags/deluge-0.5.0/setup.py seems to provide us with a clean?? way to do that.

···

Hi,

Well the point is that matplotlib in writtenin C++ and python is written in C.
The valid gcc options are not the same in C and in C++ so it looks strange (and it is a pity) if distutils do not provide the user with a way to modify these flag in this case.
XAvier

Hi,

Matplotlib uses the distutils facilities to build the extension code. Unfortunately, it is not possible to add or remove compiler flags, distutils uses the same flags as Python when it was built. So this should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419… <mailto:gnata@…419…>>:

    Hi,

    It would be great to be able to compile matplotlib without a
    warning :slight_smile:
    Unfortunately, I was not able to fix this warning performing a simple
    grep into the sources:
    "cc1plus: warning: command line option "-Wstrict-prototypes" is valid
    for Ada/C/ObjC but not for C++"
    It looks like this option is automagically added by the build
    script in
    a way I fail to understand reading quickly the sources.
    Anyway, there should be a simple solution to avoid this warning (gcc
    version 4.1.3)...
    Any comments?

    Xavier

¬†¬†¬†¬†‚Äď
    ############################################
    Xavier Gnata
    CRAL - Observatoire de Lyon
¬†¬†¬†¬†9, avenue Charles AndrÔŅĹ
    69561 Saint Genis Laval cedex
    Phone: +33 4 78 86 85 28
    Fax: +33 4 78 86 83 86
    E-mail: gnata@…419… <mailto:gnata@…419…>
    ############################################

    -------------------------------------------------------------------------

    This SF.net email is sponsored by: Splunk Inc.
    Still grepping through log files to find problems? Stop.
    Now Search log events and configuration files using AJAX and a
    browser.
    Download your FREE copy of Splunk now >> http://get.splunk.com/
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles AndrÔŅĹ
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@...419...
############################################

This is a long standing Python (distutils) bug, IMHO.

Numpy, for instance, ships with a heavily patched version of distutils that has a workaround for this. Maybe now that mpl requires Numpy, there may be some advantage to using its distutils rather than the stock one. (I say having not looked into it very deeply).

I've always got the impression that Python with C++ is sort of an afterthought -- I don't think C++ extensions are part of the regular testing procedure for distutils.

Cheers,
Mike

Matthieu Brucher wrote:

···

Hi,

Matplotlib uses the distutils facilities to build the extension code. Unfortunately, it is not possible to add or remove compiler flags, distutils uses the same flags as Python when it was built. So this should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419… <mailto:gnata@…419…>>:

    Hi,

    It would be great to be able to compile matplotlib without a
    warning :slight_smile:
    Unfortunately, I was not able to fix this warning performing a simple
    grep into the sources:
    "cc1plus: warning: command line option "-Wstrict-prototypes" is valid
    for Ada/C/ObjC but not for C++"
    It looks like this option is automagically added by the build
    script in
    a way I fail to understand reading quickly the sources.
    Anyway, there should be a simple solution to avoid this warning (gcc
    version 4.1.3)...
    Any comments?

    Xavier

¬†¬†¬†¬†‚Äď
    ############################################
    Xavier Gnata
    CRAL - Observatoire de Lyon
¬†¬†¬†¬†9, avenue Charles AndrÔŅĹ
    69561 Saint Genis Laval cedex
    Phone: +33 4 78 86 85 28
    Fax: +33 4 78 86 83 86
    E-mail: gnata@…419… <mailto:gnata@…419…>
    ############################################

    -------------------------------------------------------------------------

    This SF.net email is sponsored by: Splunk Inc.
    Still grepping through log files to find problems? Stop.
    Now Search log events and configuration files using AJAX and a
    browser.
    Download your FREE copy of Splunk now >> http://get.splunk.com/
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Yes, Python is written in C, but it is responsible for providing the good flags so that extensions are compatible with the interpreter (there is an option is Python steup for the C++ compiler for instance).
The exemple you give is valid for GCC, but is not for other compilers that will crash with this kind of options. In fact, it would be far better if Python provided out of the box a correct set of flags for g++ (and for the other C++ compilers). I have to say that with ICC, there are far more warning than for gcc.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419…>:

···

http://deluge-torrent.org/svn/tags/deluge-0.5.0/setup.py seems to
provide us with a clean?? way to do that.

Hi,

Well the point is that matplotlib in writtenin C++ and python is written

in C.
The valid gcc options are not the same in C and in C++ so it looks
strange (and it is a pity) if distutils do not provide the user with a
way to modify these flag in this case.
XAvier

Hi,

Matplotlib uses the distutils facilities to build the extension code.
Unfortunately, it is not possible to add or remove compiler flags,
distutils uses the same flags as Python when it was built. So this

should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419…
<mailto:
gnata@…419…>>:

Hi,

It would be great to be able to compile matplotlib without a
warning :)
Unfortunately, I was not able to fix this warning performing a simple
grep into the sources:
"cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++"
It looks like this option is automagically added by the build
script in
a way I fail to understand reading quickly the sources.
Anyway, there should be a simple solution to avoid this warning (gcc
version 4.1.3)...
Any comments?

Xavier

--
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles André
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@...419... <mailto:gnata@...419...>
############################################
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a
browser.
Download your FREE copy of Splunk now >>   [http://get.splunk.com/

](http://get.splunk.com/)

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
<mailto:Matplotlib-users@lists.sourceforge.net>
[

https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)



This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>
http://get.splunk.com/



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

‚Äď
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles André
69561 Saint Genis Laval cedex

Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@…419…
############################################

If numpy provide us with a distutils version that *works* IMHO matplotlib should just be shipped with.
If it is overkill, it could be possible to detect the compiler version and to remove this option if and only if g++ is used.
It looks not so clean but cleaner than compiling this an extra option and waiting for the next g++ version which may move from a warning to an error...
Maybe we should also ask on the python ML.

From http://docs.python.org/ext/building.html "distutils users should trust that distutils gets the invocations right." : ha ha ha!

Xavier

···

This is a long standing Python (distutils) bug, IMHO.

Numpy, for instance, ships with a heavily patched version of distutils that has a workaround for this. Maybe now that mpl requires Numpy, there may be some advantage to using its distutils rather than the stock one. (I say having not looked into it very deeply).

I've always got the impression that Python with C++ is sort of an afterthought -- I don't think C++ extensions are part of the regular testing procedure for distutils.

Cheers,
Mike

Matthieu Brucher wrote:
  

Hi,

Matplotlib uses the distutils facilities to build the extension code. Unfortunately, it is not possible to add or remove compiler flags, distutils uses the same flags as Python when it was built. So this should probably be sent to the Python users ML.

Matthieu

2007/7/23, Xavier Gnata <gnata@…419… <mailto:gnata@…419…>>:

    Hi,

    It would be great to be able to compile matplotlib without a
    warning :slight_smile:
    Unfortunately, I was not able to fix this warning performing a simple
    grep into the sources:
    "cc1plus: warning: command line option "-Wstrict-prototypes" is valid
    for Ada/C/ObjC but not for C++"
    It looks like this option is automagically added by the build
    script in
    a way I fail to understand reading quickly the sources.
    Anyway, there should be a simple solution to avoid this warning (gcc
    version 4.1.3)...
    Any comments?

    Xavier

¬†¬†¬†¬†‚Äď
    ############################################
    Xavier Gnata
    CRAL - Observatoire de Lyon
¬†¬†¬†¬†9, avenue Charles AndrÔŅĹ
    69561 Saint Genis Laval cedex
    Phone: +33 4 78 86 85 28
    Fax: +33 4 78 86 83 86
    E-mail: gnata@…419… <mailto:gnata@…419…>
    ############################################

    -------------------------------------------------------------------------

    This SF.net email is sponsored by: Splunk Inc.
    Still grepping through log files to find problems? Stop.
    Now Search log events and configuration files using AJAX and a
    browser.
    Download your FREE copy of Splunk now >> http://get.splunk.com/
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles AndrÔŅĹ
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gnata@...419...
############################################