diff options
author | Peter Korsgaard <peter@korsgaard.com> | 2017-01-30 23:26:20 +0100 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2017-01-31 23:37:27 +0100 |
commit | 326228b80fca35e8ca07196692ed753fff69eb18 (patch) | |
tree | 377b52fff95fc1ff2b0957a18ca5953fa7c7d0d4 /package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch | |
parent | 62e4e13e185cbc6e7a7542a2b911e7befb7f6946 (diff) | |
download | buildroot-326228b80fca35e8ca07196692ed753fff69eb18.tar.gz buildroot-326228b80fca35e8ca07196692ed753fff69eb18.zip |
log4cxx: fix build issue with gcc6+ on architectures with signed char
Fixes:
http://autobuild.buildroot.net/results/029/02946a75f478b1304896e7a0794bb6aa527e45c0/
http://autobuild.buildroot.net/results/14b/14b9cab834540a01c9c838ea579dc73e383f754a/
http://autobuild.buildroot.net/results/de8/de8f2b132084a10fbe8efb38c7b31adca4562852/
The source code contains a number of character constants > 127, which causes
build errors with gcc6+ on architectures where char is signed:
locationinfo.cpp:163:21: error: narrowing conversion of '237' from 'int' to 'char' inside { } [-Wnarrowing]
Fix it by adding an upstream patch adding explicit static_cast around these.
Also add a local patch to fix the test suite as this is not fixed upstream.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch')
-rw-r--r-- | package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch b/package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch new file mode 100644 index 0000000000..b3f43bfd7c --- /dev/null +++ b/package/log4cxx/0005-domtestcase.cpp-fix-narrowing-conversion-compile-err.patch @@ -0,0 +1,36 @@ +From afc191aec355619d6ebabb2cad660a5a8ad4569b Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard <peter@korsgaard.com> +Date: Mon, 30 Jan 2017 23:13:43 +0100 +Subject: [PATCH] domtestcase.cpp: fix narrowing conversion compile error with + gcc 6+ / signed char + +Signed-off-by: Peter Korsgaard <peter@korsgaard.com> +--- + src/test/cpp/xml/domtestcase.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/test/cpp/xml/domtestcase.cpp b/src/test/cpp/xml/domtestcase.cpp +index ad276d1a..2a1e6e2e 100644 +--- a/src/test/cpp/xml/domtestcase.cpp ++++ b/src/test/cpp/xml/domtestcase.cpp +@@ -190,7 +190,7 @@ public: + DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml")); + LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3") + #if LOG4CXX_LOGCHAR_IS_UTF8 +- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 }; ++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 }; + #else + const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 }; + #endif +@@ -209,7 +209,7 @@ public: + DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml")); + LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4") + #if LOG4CXX_LOGCHAR_IS_UTF8 +- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 }; ++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 }; + #else + const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 }; + #endif +-- +2.11.0 + |