-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
Use GCC/Clang builtins for overflows checking #4356
Comments
Hello @XVilka , want to work on it. can you assign it to me? |
@KBhushan07 done, go ahead |
Could you please review my approach for implementing GCC built-ins overflow checking in my code? I used "__builtin_add_overflow_p" for addition instead of "__builtin_add_overflow" due to the third argument requirement. For multiplication, I utilized a similar library for signed numbers, as I couldn't find one for unsigned numbers. I left subtraction unchanged since it uses addition checking internally. Lastly, I couldn't find a built-in function for division. Do you think this approach is appropriate, or do you have any suggestions for improvement? Screenshot - |
|
See
librz/include/rz_types_overflow.h
See https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
An example how Meson checks for those could be added: bbc5457
The text was updated successfully, but these errors were encountered: