From e0fcc0e1d45c26995540b4d9ba0daeee6438f4e3 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Fri, 9 Jun 2000 14:37:56 +0000 Subject: [PATCH] system.h (SSIZE_MAX): Delete backup definition. * system.h (SSIZE_MAX): Delete backup definition. * cppfiles.c (read_include_file): Use INTTYPE_MAXIMUM(ssize_t) instead of SSIZE_MAX. From-SVN: r34467 --- gcc/ChangeLog | 7 +++++++ gcc/cppfiles.c | 7 +++++-- gcc/system.h | 4 ---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f09a3bb..f6a6c20 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2000-06-09 Kaveh R. Ghazi + + * system.h (SSIZE_MAX): Delete backup definition. + + * cppfiles.c (read_include_file): Use INTTYPE_MAXIMUM(ssize_t) + instead of SSIZE_MAX. + 2000-06-09 Jakub Jelinek * configure.in: Check whether gas supports -relax. diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 71bb657..55250ae 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -727,8 +727,11 @@ read_include_file (pfile, fd, ihash) the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink - their coding style.) */ - if (st.st_size > SSIZE_MAX) + their coding style.) Some systems (e.g. AIX 4.1) define + 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 (st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, "%s is too large", ihash->name); goto fail; diff --git a/gcc/system.h b/gcc/system.h index e08c168..ab2cfa7 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -250,10 +250,6 @@ extern int errno; # define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char) #endif -#ifndef SSIZE_MAX -# define SSIZE_MAX INTTYPE_MAXIMUM (ssize_t) -#endif - #ifdef TIME_WITH_SYS_TIME # include # include -- 2.7.4