aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-08-19 11:03:01 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-08-19 13:02:11 +0100
commit65441d8fc3c132a58c8bef6faefa2bc25e82a913 (patch)
treebab239b99473d7f922535c6b57a8cca5ba683fd3 /gcc/gimple-range.h
parentc8a1cf1a7a8be1dc0de48035d88fecf4954e37ba (diff)
downloadgcc-65441d8fc3c132a58c8bef6faefa2bc25e82a913.zip
gcc-65441d8fc3c132a58c8bef6faefa2bc25e82a913.tar.gz
gcc-65441d8fc3c132a58c8bef6faefa2bc25e82a913.tar.bz2
libstdc++: Improve overflow check for file timestamps
The current code assumes that system_clock::duration is nanoseconds, and also performs a value-changing conversion from nanoseconds::max() to double (which doesn't matter after dividing by 1e9, but triggers a warning with Clang nonetheless). A better solution is to use system_clock::duration::max() and perform the comparison entirely using the std::chrono types, rather than with dimensionless arithmetic types. This doesn't address the FIXME in the function, so the overflow check still rejects some values that could be represented by the file_clock. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * src/filesystem/ops-common.h (filesystem::file_time): Improve overflow check by using system_clock::duration::max().
Diffstat (limited to 'gcc/gimple-range.h')
0 files changed, 0 insertions, 0 deletions