Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is overflow_usub?

Tags:

Linus Torvalds has recently made it to mainstream news with a rant over a pull request. This pull request included a function, overflow_usub, which is apparently non-standard and uses some kind of compiler magic. As a result of the widespread reporting of this rant, it is near-impossible to find any useful information about this function. My question is: what is overflow_usub, when should it be used and what kind of compiler magic does it require?

like image 435
Tamás Szelei Avatar asked Nov 04 '15 08:11

Tamás Szelei


People also ask

What is overflow all about?

Plot Summary (2) Close like siblings, but not blood related, a boy and two girl stays together as they grew up together and free with each other. It starts when two girl get to bath with the boy and eventually he end up tucking one of the girl with so much satisfaction and 2nd girl , at night to undo his sex hunger.


1 Answers

The function overflow_usub is defined as:

static inline bool overflow_usub(unsigned int a, unsigned int b, unsigned int *res){   *res = a - b;   return *res > a ? true : false; } 

It will check for integer overflows in subtraction and doesn't involve any compiler magic. It's usually a fallback, if the compiler has no __builtin_usub_overflow.

like image 88
Constantin Avatar answered Oct 28 '22 20:10

Constantin