[
https://issues.apache.org/jira/browse/PROTON-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15410005#comment-15410005
]
Chuck Rolke commented on PROTON-546:
------------------------------------
You can see the warnings that gcc would throw if they weren't suppressed.
{noformat}
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 0fec525..46b3a0a 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -209,7 +209,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
if (ENABLE_WARNING_ERROR)
set (WERROR "-Werror")
endif (ENABLE_WARNING_ERROR)
- set (COMPILE_WARNING_FLAGS "${WERROR} -Wall -pedantic-errors")
+ set (COMPILE_WARNING_FLAGS "-Wconversion -Wall -pedantic-errors")
# C++ allow "%z" format specifier and variadic macros
set (CXX_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-format
-Wno-variadic-macros")
if (NOT BUILD_WITH_CXX)
{noformat}
This turns off -Werror so that all files compile.
Most of the warnings are totally harmless and reflect the nature of regular C.
There are a few silent demotions/promotions of long and unsigned long to int
that may or may not be an issue.
In a recent compile with GCC 5.3.1 x86_64 vs Visual Studio 2015 64-bit there
was one int size difference of consequence that proton code does not code
around: in gcc a sizeof(long)=8 while in windows sizeof(long)=4. Same goes for
the unsigned long.
||Test||gcc||Visual Studio||
|sizeof(int )| 4 | 4 |
|sizeof(unsigned int )| 4 | 4 |
|sizeof(char )| 1 | 1 |
|sizeof(unsigned char )| 1 | 1 |
|sizeof(short )| 2 | 2 |
|sizeof(unsigned short )| 2 | 2 |
|sizeof(long )| 8 | 4 |
|sizeof(unsigned long )| 8 | 4 |
|sizeof(long long )| 8 | 8 |
|sizeof(unsigned long long)| 8 | 8 |
|sizeof(int8_t )| 1 | 1 |
|sizeof(uint8_t )| 1 | 1 |
|sizeof(int16_t )| 2 | 2 |
|sizeof(uint16_t )| 2 | 2 |
|sizeof(int32_t )| 4 | 4 |
|sizeof(uint32_t )| 4 | 4 |
|sizeof(int64_t )| 8 | 8 |
|sizeof(uint64_t )| 8 | 8 |
> C++ Windows warnings: conversions and possible loss of data
> -----------------------------------------------------------
>
> Key: PROTON-546
> URL: https://issues.apache.org/jira/browse/PROTON-546
> Project: Qpid Proton
> Issue Type: Bug
> Components: proton-c
> Affects Versions: 0.6
> Reporter: Chuck Rolke
> Assignee: Andrew Stitcher
> Labels: windows
> Attachments: PROTON-546-size-warnings.txt
>
>
> Windows has other warnings similar to PROTON-545, especially during 64-bit
> builds.
> See attached file for details.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]