summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch
new file mode 100644
index 00000000..ae275174
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch
@@ -0,0 +1,48 @@
+From b6b1782af4aa7f9084d32e4144738dc2535c8d6f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Apr 2018 23:07:21 -0700
+Subject: [PATCH] Fix narrowing errors -Wc++11-narrowing
+
+Clang 6.x finds these errors
+
+ ../../../../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 ;
+ ^
+
+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.
+
+also reported here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224930
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CPP/Windows/ErrorMsg.cpp | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp
+index 99684ae..78a64ba 100644
+--- a/CPP/Windows/ErrorMsg.cpp
++++ b/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);