From owner-svn-src-all@freebsd.org Tue Sep 22 22:07:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639D6A07829; Tue, 22 Sep 2015 22:07:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5394E1C45; Tue, 22 Sep 2015 22:07:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MM7hg1066261; Tue, 22 Sep 2015 22:07:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MM7hsF066260; Tue, 22 Sep 2015 22:07:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222207.t8MM7hsF066260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288133 - in stable: 10/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:07:43 -0000 Author: dim Date: Tue Sep 22 22:07:42 2015 New Revision: 288133 URL: https://svnweb.freebsd.org/changeset/base/288133 Log: 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. Modified: stable/10/contrib/gcclibs/libcpp/files.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/gcclibs/libcpp/files.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/10/contrib/gcclibs/libcpp/files.c ============================================================================== --- stable/10/contrib/gcclibs/libcpp/files.c Tue Sep 22 21:43:08 2015 (r288132) +++ stable/10/contrib/gcclibs/libcpp/files.c Tue Sep 22 22:07:42 2015 (r288133) @@ -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);