diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-02 15:46:55 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-02 15:46:55 -0800 |
commit | b87323aac6ec6a4e12e813fa2214e8a480b77d13 (patch) | |
tree | e649b192c3b535e1757aa0ee6328deab1a588b3f /gps.h | |
parent | b73abff012abacf770a9f59fb054b721e2b9e336 (diff) | |
download | gpsd-b87323aac6ec6a4e12e813fa2214e8a480b77d13.tar.gz |
Comment possible numeric overflow in timespec_diff_ns()
timespec_diff_ns() should not be used is the delta is more than
about 2 seconds.
Diffstat (limited to 'gps.h')
-rw-r--r-- | gps.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1891,6 +1891,7 @@ struct timedrift_t { /* difference between timespecs in nanoseconds */ /* int is too small, avoid floats */ +/* WARNING! this will overflow if x and y differ by more than a few seconds */ #define timespec_diff_ns(x, y) (long)(((x).tv_sec-(y).tv_sec)*1000000000+(x).tv_nsec-(y).tv_nsec) /* |