support gcc 5 builtins for multiplication overflow in safemult.h
fix copypasted comment in fmt_asn1dertag add man pages for add_of, sub_of and assignmaster
parent
6cfc16fc40
commit
fb1f19042f
@ -0,0 +1,21 @@
|
||||
.TH add_of 3
|
||||
.SH NAME
|
||||
add_of \- add two integers, check for arithmetic overflow
|
||||
.SH SYNTAX
|
||||
.B #include <rangecheck.h>
|
||||
|
||||
int \fBadd_of\fP(dest,a,b);
|
||||
.SH DESCRIPTION
|
||||
If calculating a+b is possible without causing undefined behavior or an
|
||||
arithmetic overflow in C, and the sum fits into the destination integer
|
||||
type, do dest=a+b and return 0.
|
||||
|
||||
Otherwise, return 1.
|
||||
|
||||
Note: This is a macro, so dest does not have to be a pointer.
|
||||
.SH BUGS
|
||||
In the multiplication functions, a return value of 1 signals success and
|
||||
0 failure. In add_of, sub_of and assign it's the other way around.
|
||||
.SH "SEE ALSO"
|
||||
sub_of(3), assign(3), imult16(3), umult16(3), imult32(3), umult32(3),
|
||||
imult64(3), umult64(3)
|
@ -0,0 +1,20 @@
|
||||
.TH assign 3
|
||||
.SH NAME
|
||||
assign \- assign an integer value, check for truncation
|
||||
.SH SYNTAX
|
||||
.B #include <rangecheck.h>
|
||||
|
||||
int \fBassign\fP(dest,a);
|
||||
.SH DESCRIPTION
|
||||
If a and dest have the same type, or the value of a is representable in
|
||||
the type of dest, do dest=a and return 0.
|
||||
|
||||
Otherwise, return 1.
|
||||
|
||||
Note: This is a macro, so dest does not have to be a pointer.
|
||||
.SH BUGS
|
||||
In the multiplication functions, a return value of 1 signals success and
|
||||
0 failure. In add_of, sub_of and assign it's the other way around.
|
||||
.SH "SEE ALSO"
|
||||
add_of(3), sub_of(3), imult16(3), umult16(3), imult32(3), umult32(3),
|
||||
imult64(3), umult64(3)
|
@ -0,0 +1,21 @@
|
||||
.TH sub_of 3
|
||||
.SH NAME
|
||||
sub_of \- subtract two integers, check for arithmetic overflow
|
||||
.SH SYNTAX
|
||||
.B #include <rangecheck.h>
|
||||
|
||||
int \fBsub_of\fP(dest,a,b);
|
||||
.SH DESCRIPTION
|
||||
If calculating a-b is possible without causing undefined behavior or an
|
||||
arithmetic overflow in C, and the result fits into the destination
|
||||
integer type, do dest=a-b and return 0.
|
||||
|
||||
Otherwise, return 1.
|
||||
|
||||
Note: This is a macro, so dest does not have to be a pointer.
|
||||
.SH BUGS
|
||||
In the multiplication functions, a return value of 1 signals success and
|
||||
0 failure. In add_of, sub_of and assign it's the other way around.
|
||||
.SH "SEE ALSO"
|
||||
add_of(3), assign(3), imult16(3), umult16(3), imult32(3), umult32(3),
|
||||
imult64(3), umult64(3)
|
Loading…
Reference in New Issue