[
https://issues.apache.org/jira/browse/PROTON-1324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15592219#comment-15592219
]
Andrew Stitcher commented on PROTON-1324:
-----------------------------------------
This has nothing to do with the type int8_t. I'm not sure why you even mention
it.
It is entirely true that whether char is signed or not is not language defined.
However I think this test is wrong (as is the original code unfortunately).
gcc actually has a compiler flag which overrides the default char being signed
and I'm pretty sure SunPro does too.
So the original code is wrong beacuse it has no way to know what this flags
setting is.
(For gcc the flag is "-funsigned-char")
In terms of actually fixing this bug I'd strongly suggest using the Sunpro
equivalent of "-fsigned-char". instead of the conditional compile.
> Interpretation of "int8_t" on Solaris using SunStudio is different from GCC
> one
> -------------------------------------------------------------------------------
>
> Key: PROTON-1324
> URL: https://issues.apache.org/jira/browse/PROTON-1324
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Reporter: Adel Boutros
> Assignee: Cliff Jansen
> Attachments: 0010-SunStudio-Fix-the-interpretation-of-int8_t.patch
>
>
> Looking at the standard, there are actually 3 ways to define a char:
> * char
> * signed char
> * unsigned char
> There are no specificatoins regarding what "char" will be interperted as
> either "signed char" or "unsigned char". This is left to the OS/Compiler to
> choose.
> Solaris: int8_t --> char
> Linux: int8_t --> signed char
> You can check here: http://en.cppreference.com/w/cpp/language/types
> {quote}
> char - type for character representation which can be most efficiently
> processed on the target system (has the same representation and alignment as
> either signed char or unsigned char, but is always a distinct type).
> Multibyte characters strings use this type to represent code units.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]