diff options
author | dim <dim@FreeBSD.org> | 2015-09-22 22:07:42 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-22 22:07:42 +0000 |
commit | 3606495e8736021e5110ce62eacbe9816f0015e7 (patch) | |
tree | d132fec12685b7ecede5c274086ac058dfc78fcc | |
parent | 7b9023e28a0afc962de748df57af9704b4bfd73f (diff) | |
download | FreeBSD-src-3606495e8736021e5110ce62eacbe9816f0015e7.zip FreeBSD-src-3606495e8736021e5110ce62eacbe9816f0015e7.tar.gz |
MFC r286699:
In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on
undefined behavior. The code used this macro to avoid problems on some
broken systems which define SSIZE_MAX incorrectly, but this is not
needed on FreeBSD, obviously.
-rw-r--r-- | contrib/gcclibs/libcpp/files.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/gcclibs/libcpp/files.c b/contrib/gcclibs/libcpp/files.c index 366d30a..95cda0e 100644 --- a/contrib/gcclibs/libcpp/files.c +++ b/contrib/gcclibs/libcpp/files.c @@ -567,7 +567,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file) SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ - if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) + if (file->st.st_size > SSIZE_MAX) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path); return false; @@ -581,7 +581,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file) file->path); return false; } - else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size) + else if (offset > SSIZE_MAX || (ssize_t)offset > size) { cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large", file->path); |