Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-27643 - fix test_ctypes test_bitfields with XLC compiler. #5164

Merged
merged 2 commits into from
Dec 26, 2018

Conversation

aixtools
Copy link
Contributor

@aixtools aixtools commented Jan 12, 2018

This PR skips the "signed short" bitfield test when the compiler is XLC
It also removes the failing code (signed short declaration) in test_bitfields.py and _ctypes_test.c)

https://bugs.python.org/issue27643

IBM XLC compiler (on AIX) does not support this
Skip the code and test when AIX and XLC are used
@aixtools aixtools changed the title issue 27643 - Test_C test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this #27643 - Test_C test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this Jan 12, 2018
@aixtools aixtools changed the title #27643 - Test_C test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this bpo-27643 - Test_C test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this Jan 12, 2018
@trudeaun
Copy link

@aixtools I noticed this line in your code:
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 /* Something to distinguish GCC and XLC */
Another way to distinguish GCC and XL would be to check if __xlc__ is defined. See Knowledge Center for more details.

@trudeaun
Copy link

@aixtools I believe the latest C standard does not state that signed short is a valid data type in a bitfield, so XLC does not support it. When compiling your code with XLC, you may have seen an error such as: 1506-159 (E) Bit field type specified for xyz is not valid. Type signed assumed., which converts your signed short into the closest valid type identified by the standard, signed.

@aixtools
Copy link
Contributor Author

aixtools commented Jan 15, 2018 via email

@aixtools aixtools changed the title bpo-27643 - Test_C test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this bpo-27643 - fix test_ctypes test_bitfields with XLC compiler. "signed short" bitfields are not supported by XLC Aug 11, 2018
@aixtools aixtools changed the title bpo-27643 - fix test_ctypes test_bitfields with XLC compiler. "signed short" bitfields are not supported by XLC bpo-27643 - fix test_ctypes test_bitfields with XLC compiler. Sep 16, 2018
@ncoghlan ncoghlan merged commit 22462da into python:master Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants