-
Notifications
You must be signed in to change notification settings - Fork 201
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
Builtin integer overflow functions not known #271
Comments
@davmac314 did a few of the builtins last year, looking at their contributions would be a good place to start on how to implement these. |
Well, I already looked at the existing code and have an idea how to do it, but the questions that I mentioned regarding the types remain. If these are answered I can send a PR. The contributions from davmac314 all seem to add concrete semantics for builtin functions for C++, this is not what I am attempting to do. I just want do add declarations. |
IIRC the type string is parsed as a C type (if it is not empty) by |
GCC has a set of builtin functions for performing integer arithmetic with overflow checking, for example
__builtin_sadd_overflow
etc. These are not present in CDT's list of builtin functions, so code using them will be parsed with wrong types for these function calls.It seems that adding them should be easy, however, there are some functions like
__builtin_add_overflow
which are declared like this:type1
,type2
, andtype3
can be any integral type. How should this be represented inside CDT?__builtin_types_compatible_p
, which is also a builtin "function" with a signature that is not expressible in C , uses""
as type for each parameter, whichcreateType(String)
seems to translate to a basic type with kindeUnspecified
and no modifiers. Maybe this fits here as well? If yes, should the type ofres
be a void pointer or maybe something like"*"
?The text was updated successfully, but these errors were encountered: