This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: compiler warning "sqrtpi defined but not used"
Type: Stage: resolved
Components: Build Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: louielu, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach, xiang.zhang
Priority: normal Keywords:

Created on 2017-03-30 08:28 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 908 merged louielu, 2017-03-30 16:16
Messages (4)
msg290836 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-03-30 08:28
Ubuntu 16.10, GCC 6.2.0

/home/angwer/repos/cpython/Modules/mathmodule.c:74:21: warning: ‘sqrtpi’ defined but not used [-Wunused-const-variable=]
 static const double sqrtpi = 1.772453850905516027298167483341145182798;
msg290837 - (view) Author: Louie Lu (louielu) * Date: 2017-03-30 08:43
I can reproduce on ArchLinux 4.10.1-1, GCC 6.3.1:

/home/louielu/Python/cpython/Modules/mathmodule.c:74:21: warning: ‘sqrtpi’ defined but not used [-Wunused-const-variable=]
 static const double sqrtpi = 1.772453850905516027298167483341145182798;

----

Is used by `m_erfc_contfrac` and `m_erf_series`, and inside the block of "#if !defined(HAVE_ERF) || !defined(HAVE_ERFC)", maybe sqrtpi should do the same condition?
msg290854 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2017-03-30 15:57
This is almost certainly the result of #26121.

+1 to moving the `sqrtpi` definition inside the relevant `#if` blocks.
msg290862 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-30 17:05
New changeset 7a26464c6496c29244072fdd80f9b92c68174742 by Serhiy Storchaka (Louie Lu) in branch 'master':
bpo-29946: Fix "sqrtpi defined but not used" (#908)
https://github.com/python/cpython/commit/7a26464c6496c29244072fdd80f9b92c68174742
History
Date User Action Args
2022-04-11 14:58:44adminsetgithub: 74132
2017-03-31 03:22:25xiang.zhangsetstatus: open -> closed
resolution: fixed
stage: resolved
2017-03-30 17:05:12serhiy.storchakasetmessages: + msg290862
2017-03-30 16:16:10louielusetpull_requests: + pull_request808
2017-03-30 15:57:01mark.dickinsonsetnosy: + serhiy.storchaka
messages: + msg290854
2017-03-30 15:08:34pitrousetnosy: + rhettinger, mark.dickinson, stutzbach
2017-03-30 08:43:39louielusetnosy: + louielu
messages: + msg290837
2017-03-30 08:28:04xiang.zhangcreate