classification
Title: Argument Clinic incorretly translates #elif
Type: compile error Stage: resolved
Components: Argument Clinic, Build Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-04-04 16:26 by serhiy.storchaka, last changed 2020-04-18 16:13 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19364 merged serhiy.storchaka, 2020-04-04 16:37
PR 19360 serhiy.storchaka, 2020-04-04 16:45
PR 19583 merged serhiy.storchaka, 2020-04-18 14:58
PR 19584 merged serhiy.storchaka, 2020-04-18 15:09
Messages (6)
msg365769 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-04 16:26
It converts

    #if A
    ...
    #elif B
    ...
    #else
    ...
    #endif

into

    #if A
    ...
    #endif /* A */

    #if B
    ...
    #endif /* B */

    #if !B
    ...
    #endif /* !B */

The correct translation is:

    #if A
    ...
    #endif /* A */

    #if !A && B
    ...
    #endif /* !A && B */

    #if !A && !B
    ...
    #endif /* !A && !B */
msg365772 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2020-04-04 19:07
Good catch, and thanks for submitting a patch too!  I want to play with your patch a little before I just say "yes of course".
msg365790 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-04 21:29
See PR 19360 for real example.
msg366721 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-18 14:52
New changeset 12446e6a605f066d837d3a595d0a73e4f3b43b65 by Serhiy Storchaka in branch 'master':
bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364)
https://github.com/python/cpython/commit/12446e6a605f066d837d3a595d0a73e4f3b43b65
msg366723 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-18 16:11
New changeset bfda4db0d2c05eef4e4ae90d899d0b67cb2e33e5 by Serhiy Storchaka in branch '3.8':
[3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583)
https://github.com/python/cpython/commit/bfda4db0d2c05eef4e4ae90d899d0b67cb2e33e5
msg366724 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-18 16:12
New changeset 67ae454da749a7ca67115b43205d9fe98bea3213 by Serhiy Storchaka in branch '3.7':
[3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584)
https://github.com/python/cpython/commit/67ae454da749a7ca67115b43205d9fe98bea3213
History
Date User Action Args
2020-04-18 16:13:03serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-04-18 16:12:18serhiy.storchakasetmessages: + msg366724
2020-04-18 16:11:52serhiy.storchakasetmessages: + msg366723
2020-04-18 15:09:07serhiy.storchakasetpull_requests: + pull_request18921
2020-04-18 14:58:19serhiy.storchakasetpull_requests: + pull_request18920
2020-04-18 14:52:51serhiy.storchakasetmessages: + msg366721
2020-04-04 21:29:27serhiy.storchakasetmessages: + msg365790
2020-04-04 19:07:34larrysetmessages: + msg365772
2020-04-04 16:45:49serhiy.storchakasetpull_requests: + pull_request18727
2020-04-04 16:37:37serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request18726
2020-04-04 16:26:41serhiy.storchakacreate