You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/vfs/smbfs/helpers/lib/time.c:177:16: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
src/vfs/smbfs/helpers/lib/time.c:181:16: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
and they seems to be valid, and gcc people do intend to make gcc play tricks under "signed overflow is undefined, so we can assume it never happens" banner.
The patch was sent by email with subject line
"Fix code which depends on signed overflow in C (which isn't defined in C)".
For your easy reference, it is just:
/* no entry will cover more than 6 months */
- low = t - MAX_DST_WIDTH / 2;
- if (t < low)
+ if (t > TIME_T_MIN + MAX_DST_WIDTH / 2)
+ low = t - MAX_DST_WIDTH / 2;
+ else
low = TIME_T_MIN;
- high = t + MAX_DST_WIDTH / 2;
- if (high < t)
+ if (t < TIME_T_MAX - MAX_DST_WIDTH / 2)
+ high = t + MAX_DST_WIDTH / 2;
+ else
high = TIME_T_MAX;
The text was updated successfully, but these errors were encountered:
Important
This issue was migrated from Trac:
vda
(@dvlasenk)The warnings are:
src/vfs/smbfs/helpers/lib/time.c:177:16: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
src/vfs/smbfs/helpers/lib/time.c:181:16: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
and they seems to be valid, and gcc people do intend to make gcc play tricks under "signed overflow is undefined, so we can assume it never happens" banner.
The patch was sent by email with subject line
"Fix code which depends on signed overflow in C (which isn't defined in C)".
For your easy reference, it is just:
The text was updated successfully, but these errors were encountered: