Displaying 1 result from an estimated 1 matches for "abval".
Did you mean:
a_val
2013 Jan 08
0
[PATCH] avoid undefined behavior in fmt_scaled()
fmt_scaled() computes the absolute value of its argument, and returns an
error if the result is still negative (i.e., when the value is LLONG_MIN).
However, taking the negative of LLONG_MIN is undefined behavior in C, and
some compilers (e.g., gcc-4.7.2) will optimize away the 'abval < 0' check
as being always false (since it can only be true with undefined behavior).
The patch below performs an equivalent check without invoking undefined
behavior.
Nickolai.
--- openssh-6.1p1/openbsd-compat/fmt_scaled.c 2008-05-19 18:57:08.000000000 -0400
+++ openssh-6.1p1/openbsd-co...