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: CCompiler has_function displays warning
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, dstufft, eric.araujo, maarten, miss-islington
Priority: normal Keywords: patch

Created on 2019-08-27 20:47 by maarten, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
0001-Fix-compiler-warning-of-distutils-CCompiler.test_fun.patch maarten, 2019-08-27 20:47
Pull Requests
URL Status Linked Edit
PR 15560 merged maarten, 2019-08-28 11:39
PR 15561 merged miss-islington, 2019-08-28 17:11
PR 15562 merged miss-islington, 2019-08-28 17:11
PR 15563 merged miss-islington, 2019-08-28 17:11
Messages (7)
msg350645 - (view) Author: Maarten (maarten) * Date: 2019-08-27 20:47
When using the `has_function` method of a CCompiler object,
the compiler will emit a warning because the main function has no return type specified.

https://github.com/python/cpython/blob/8c9e9b0cd5b24dfbf1424d1f253d02de80e8f5ef/Lib/distutils/ccompiler.py#L784-L786

This warning is emitted:
/tmp/clockq2_azlzj.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main (int argc, char **argv) {
      | ^~~~

This happens under Linux, gcc 9
msg350649 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2019-08-28 01:42
seems like a good patch. Can you submit a PR?
msg350661 - (view) Author: Maarten (maarten) * Date: 2019-08-28 11:57
I have submitted a PR to github:
https://github.com/python/cpython/pull/15560
msg350676 - (view) Author: miss-islington (miss-islington) Date: 2019-08-28 17:11
New changeset 55aabee07501e1468082b3237620e4ecd75c5da6 by Miss Islington (bot) (Anonymous Maarten) in branch 'master':
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
https://github.com/python/cpython/commit/55aabee07501e1468082b3237620e4ecd75c5da6
msg350679 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2019-08-28 17:32
New changeset 23985c6a64222df46cd7e21b9b21c0e37aa95e10 by Benjamin Peterson (Miss Islington (bot)) in branch '3.8':
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15561)
https://github.com/python/cpython/commit/23985c6a64222df46cd7e21b9b21c0e37aa95e10
msg350680 - (view) Author: miss-islington (miss-islington) Date: 2019-08-28 17:36
New changeset 0229b56d8c0cb65b8ad789e69dcd281fd92a6d96 by Miss Islington (bot) in branch '2.7':
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
https://github.com/python/cpython/commit/0229b56d8c0cb65b8ad789e69dcd281fd92a6d96
msg350681 - (view) Author: miss-islington (miss-islington) Date: 2019-08-28 17:37
New changeset ea48966e5d868e2863d896ee909460d482a0513c by Miss Islington (bot) in branch '3.7':
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
https://github.com/python/cpython/commit/ea48966e5d868e2863d896ee909460d482a0513c
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82146
2019-08-28 17:37:41miss-islingtonsetmessages: + msg350681
2019-08-28 17:36:21miss-islingtonsetmessages: + msg350680
2019-08-28 17:32:38benjamin.petersonsetmessages: + msg350679
2019-08-28 17:11:40miss-islingtonsetpull_requests: + pull_request15238
2019-08-28 17:11:32miss-islingtonsetpull_requests: + pull_request15237
2019-08-28 17:11:25miss-islingtonsetpull_requests: + pull_request15236
2019-08-28 17:11:12miss-islingtonsetstatus: open -> closed

nosy: + miss-islington
messages: + msg350676

resolution: fixed
stage: patch review -> resolved
2019-08-28 11:57:46maartensetmessages: + msg350661
2019-08-28 11:39:21maartensetstage: patch review
pull_requests: + pull_request15233
2019-08-28 01:42:33benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg350649
2019-08-27 20:47:14maartencreate