From owner-svn-ports-all@freebsd.org Fri Jan 5 21:45:15 2018 Return-Path: Delivered-To: svn-ports-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 4BECBEC2609; Fri, 5 Jan 2018 21:45:15 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 22DD57FEFA; Fri, 5 Jan 2018 21:45:15 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w05LjEYh002736; Fri, 5 Jan 2018 21:45:14 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w05LjEo1002735; Fri, 5 Jan 2018 21:45:14 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201801052145.w05LjEo1002735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Fri, 5 Jan 2018 21:45:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r458172 - head/archivers/p7zip/files X-SVN-Group: ports-head X-SVN-Commit-Author: rakuco X-SVN-Commit-Paths: head/archivers/p7zip/files X-SVN-Commit-Revision: 458172 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2018 21:45:15 -0000 Author: rakuco Date: Fri Jan 5 21:45:13 2018 New Revision: 458172 URL: https://svnweb.freebsd.org/changeset/ports/458172 Log: Add a patch to fix the build with Clang 6.0. ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ^ ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG' #define E_INVALIDARG ((HRESULT)0x80070057L) ^ HRESULT causes the macro to be parsed as a signed long, so we need to force it to be checked as an unsigned long instead. PR: 224930 Added: head/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp (contents, props changed) Added: head/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp Fri Jan 5 21:45:13 2018 (r458172) @@ -0,0 +1,33 @@ +This fixes the build with Clang 6.0: + + ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; + ^ + ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG' + #define E_INVALIDARG ((HRESULT)0x80070057L) + ^ + +The HRESULT cast in the macro causes the value to be read as signed int. +--- CPP/Windows/ErrorMsg.cpp.orig 2015-01-18 18:20:28 UTC ++++ CPP/Windows/ErrorMsg.cpp +@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) + + switch(errorCode) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; +- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; +- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +- case E_ABORT : txt = "E_ABORT"; break ; +- case E_FAIL : txt = "E_FAIL"; break ; +- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; +- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; +- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ++ case (DWORD)(E_NOTIMPL) : txt = "E_NOTIMPL"; break ; ++ case (DWORD)(E_NOINTERFACE) : txt = "E_NOINTERFACE"; break ; ++ case (DWORD)(E_ABORT) : txt = "E_ABORT"; break ; ++ case (DWORD)(E_FAIL) : txt = "E_FAIL"; break ; ++ case (DWORD)(STG_E_INVALIDFUNCTION) : txt = "STG_E_INVALIDFUNCTION"; break ; ++ case (DWORD)(E_OUTOFMEMORY) : txt = "E_OUTOFMEMORY"; break ; ++ case (DWORD)(E_INVALIDARG) : txt = "E_INVALIDARG"; break ; + case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode);