#19899: Use -Wno-unused to compile Python + Python packages
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-7.0
Component: packages: | Resolution:
standard | Merged in:
Keywords: | Reviewers:
Authors: Jeroen Demeyer | Work issues:
Report Upstream: N/A | Commit:
Branch: | 0375847bf1688af6f59e83a0dcb8992a82413c80
u/jdemeyer/ticket/19899 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by jdemeyer):
* status: new => needs_review
* commit: => 0375847bf1688af6f59e83a0dcb8992a82413c80
Old description:
> Currently, the Sage is compiled with `-w` which suppresses all warnings.
> I don't think that is a good idea because there might be useful warnings.
>
> One kind of warning which appears a lot is unused functions or variables
> because of the way that Cython generates code. Such warnings also appear
> in external Cython packages which use Sage. Therefore, we simply compile
> Python with `-Wno-unused` which is then passes down to all Python
> packages.
>
> I noticed something else strange: Python puts `CFLAGS` ''before'' its own
> flags like `-O3`. But there is also a variable `EXTRA_CFLAGS` which is
> put after Python's flags. Since we usually want user flags to override
> the package flags, we put the user's `CFLAGS` into `EXTRA_CFLAGS`.
New description:
One kind of warning which appears a lot in Cython-generated code is unused
functions or variables. Such warnings also appear in external Cython
packages which use Sage. Therefore, this ticket proposes to compile Python
with `-Wno-unused` which is then passes down to all Python packages.
Currently, the Sage library is compiled with `-w` which suppresses all
warnings. I don't think that is a good idea because we might miss useful
warnings. This ticket doesn't change that, but it will help to cut down
the number of harmless "unused" warnings if we do change that.
I noticed something else strange: Python puts `CFLAGS` ''before'' its own
flags like `-O3`. But there is also a variable `EXTRA_CFLAGS` which is put
after Python's flags. Since we usually want user flags to override the
package flags, we put the user's `CFLAGS` into `EXTRA_CFLAGS`.
--
Comment:
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=0375847bf1688af6f59e83a0dcb8992a82413c80
0375847]||{{{Use -Wno-unused flag for Python}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/19899#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.