Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2015 20:16:14 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286699 - head/contrib/gcclibs/libcpp
Message-ID:  <201508122016.t7CKGElN014072@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Aug 12 20:16:13 2015
New Revision: 286699
URL: https://svnweb.freebsd.org/changeset/base/286699

Log:
  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.
  
  MFC after: 3 days

Modified:
  head/contrib/gcclibs/libcpp/files.c

Modified: head/contrib/gcclibs/libcpp/files.c
==============================================================================
--- head/contrib/gcclibs/libcpp/files.c	Wed Aug 12 20:08:54 2015	(r286698)
+++ head/contrib/gcclibs/libcpp/files.c	Wed Aug 12 20:16:13 2015	(r286699)
@@ -567,7 +567,7 @@ read_file_guts (cpp_reader *pfile, _cpp_
 	 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->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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508122016.t7CKGElN014072>