Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
overflow.h File Reference

arithmetic overflow helpers More...

#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for overflow.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static bool sadd_overflow (int a, int b, int *res)
 

Detailed Description

Replace this with stdckdint.h when moving to C23.

Definition in file overflow.h.

Function Documentation

◆ sadd_overflow()

static bool sadd_overflow ( int  a,
int  b,
int *  res 
)
inlinestatic

add two integers, checking for overflow

Parameters
aOperand 1
bOperand 2
res[out] Result on success
Returns
True if overflow would occur

Definition at line 21 of file overflow.h.

References NULL.

Referenced by x_cutval().

Here is the caller graph for this function: