Graphviz 13.0.0~dev.20241220.2304
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: