[ 
https://issues.apache.org/jira/browse/LOGCXX-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605016#comment-14605016
 ] 

Alex Afanasyev commented on LOGCXX-400:
---------------------------------------

There is another file with the same problem:

{code:title=domtestcast.cpp.patch}
diff --git a/src/test/cpp/xml/domtestcase.cpp b/src/test/cpp/xml/domtestcase.cpp
index a500628..29d67dd 100644
--- a/src/test/cpp/xml/domtestcase.cpp
+++ b/src/test/cpp/xml/domtestcase.cpp
@@ -190,9 +190,9 @@ 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 };
+                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 
0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
 #endif
                 File file;
                 file.setPath(fname);
@@ -209,9 +209,9 @@ 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 };
+                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 
0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
 #endif
                 File file;
                 file.setPath(fname);
{code}

> C++11 does not allow char literals with highest bit set unless cast
> -------------------------------------------------------------------
>
>                 Key: LOGCXX-400
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-400
>             Project: Log4cxx
>          Issue Type: Bug
>    Affects Versions: 0.10.0
>         Environment: XCode 4.5, clang set to C++11
>            Reporter: Andrew Lazarus
>            Assignee: Curt Arnold
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> C++11 has tighter rules for widening of literals. In particular, 0xFF (for 
> example) is an unsigned short unless cast otherwise.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to