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

Explicitly remove __SIZEOF_INT128__ definition. #419

Merged
merged 1 commit into from
Oct 16, 2021

Conversation

roconnor-blockstream
Copy link
Contributor

Compcert does not support 128-bit integers, but the gcc preprocessor does include support as part of its 'built-in' https://github.com/gcc-mirror/gcc/blob/ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc/gcc/c-family/c-cppbuiltin.c#L1558-L1564.

A common way of testing for 128-bit integer support is to check to see if 'SIZEOF_INT128' is defined. Eliminating this macro prevents software from believing that 128-bit integers are supported.

Compcert does not support 128-bit integers, but the gcc preprocessor does include support as part of its 'built-in' <https://github.com/gcc-mirror/gcc/blob/ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc/gcc/c-family/c-cppbuiltin.c#L1558-L1564>.

A common way of testing for 128-bit integer support is to check to see if '__SIZEOF_INT128__' is defined.  Eliminating this macro prevents software from believing that 128-bit integers are supported.
Copy link
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks safe and useful. Thanks for the suggestion!

@xavierleroy xavierleroy merged commit a420914 into AbsInt:master Oct 16, 2021
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.

2 participants