Opened 6 years ago

Last modified 6 years ago

#19899 closed enhancement

Use -Wno-unused to compile Python + Python packages — at Version 2

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-7.0
Component: packages: standard Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: u/jdemeyer/ticket/19899 (Commits, GitHub, GitLab) Commit: 0375847bf1688af6f59e83a0dcb8992a82413c80
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

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.

Change History (2)

comment:1 Changed 6 years ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/19899

comment:2 Changed 6 years ago by jdemeyer

  • Commit set to 0375847bf1688af6f59e83a0dcb8992a82413c80
  • Description modified (diff)
  • Status changed from new to needs_review

New commits:

0375847Use -Wno-unused flag for Python
Note: See TracTickets for help on using tickets.