[NO REPLY] Operators (rev #2, 2018-1-15)

A place of insane ideas, nothing to see here.
User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

[NO REPLY] Operators (rev #2, 2018-1-15)

Postby Giovanni » Sun Dec 10, 2017 6:32 pm

The overflow operator

Simply put, something ho handle arithmetic overflows or underflows without having to extend the integer size, example:

Code: Select all

if (ovf d = a + b - c) {
  error();
}


  • Lowest priority.
  • Operates on integer types.
  • Only perform checks on + - *
  • Basically it is a carry flag check after each operation.
  • It is an unary operator, the check is done on all compatible elementary operations on the right side expression

Giovanni

Return to “Safer C”

Who is online

Users browsing this forum: No registered users and 8 guests