-
Notifications
You must be signed in to change notification settings - Fork 273
ansi-c: clang extensions #2628
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
ansi-c: clang extensions #2628
Changes from all commits
3849bb0
16a49a7
e63402e
5495625
8288a72
f74c161
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// for gcc, __float80 and __float128 are typedefs | ||
// for clang, __float128 is a keyword, and __float80 doesn't exist. | ||
|
||
#ifdef __clang__ | ||
int __float80; | ||
__float128 f128; | ||
#else | ||
__float80 f80; | ||
__float128 f128; | ||
#endif | ||
|
||
int main() | ||
{ | ||
#ifndef __clang__ | ||
// on gcc, they can be re-declared, as they are identifiers, not keywords | ||
int __float80; | ||
int __float128; | ||
#endif | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE gcc-only | ||
main.c | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
^CONVERSION ERROR$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ cat > builtins.h <<EOF | |
// some newer versions of GCC apparently support __floatXYZ | ||
#define dfloat32_type_node __float32 | ||
#define dfloat64_type_node __float64 | ||
#define dfloat128_type_node __float128 | ||
#define dfloat128_type_node __CPROVER_Float128 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Randomly placing this comment: the commit message says "bugfix" but it's not clear how this bug has been found/how a future regression is avoided? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was found by running the existing regressions on FreeBSD, and repeating that should avoid it in the future as well. |
||
|
||
#define build_qualified_type(t, q) q t | ||
#define build_pointer_type(t) t* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps run the test against Clang too, but checking for the expected syntax error in the .desc file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have means to enable clang as preprocessor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goto-cc --native-compiler=clang should do so, I believe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; are we willing to add clang as a dependency for CI for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's more an "in principle we could" case. We'll probably do if/when we run into a regression on this :-)