You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/01/02 23:21:50 UTC

[jira] [Commented] (PROTON-420) Warnings Presented When Using Strict Compiler Flags

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

ASF subversion and git services commented on PROTON-420:
--------------------------------------------------------

Commit 1554940 from rhs@apache.org in branch 'proton/trunk'
[ https://svn.apache.org/r1554940 ]

PROTON-420: added -Wstrict-prototypes to compile flags

> Warnings Presented When Using Strict Compiler Flags
> ---------------------------------------------------
>
>                 Key: PROTON-420
>                 URL: https://issues.apache.org/jira/browse/PROTON-420
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.5
>         Environment: GCC 4.4.7
>            Reporter: Frank Quinn
>         Attachments: FIX-Warnings-Presented-When-Using-Strict-Compiler-Flags-PROTON-420.patch
>
>
> Hi Folks,
> In our project, we currently use the following compiler flags for gcc (tested in version 4.4.7):
> -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Werror
> Unfortunately this causes problems in recent versions of proton as its headers produce some warnings of their own. The ones we have spotted can be recreated using the following code:
> #include <proton/error.h>
> #include <proton/messenger.h>
> int main(){}
> Compiled with:
> $ gcc -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Werror -I./qpid-proton-0.5/proton-c/include/ test.c -o test
> cc1: warnings being treated as errors
> In file included from test.c:1:
> ./qpid-proton-0.5/proton-c/include/proton/error.h:46: error: function declaration isn’t a prototype
> In file included from test.c:2:
> ./qpid-proton-0.5/proton-c/include/proton/messenger.h:458:29: error: "/*" within comment
> ./qpid-proton-0.5/proton-c/include/proton/messenger.h:466:40: error: "/*" within comment
> ./qpid-proton-0.5/proton-c/include/proton/messenger.h:470:32: error: "/*" within comment
> ./qpid-proton-0.5/proton-c/include/proton/messenger.h:475:34: error: "/*" within comment
> test.c:4: error: function declaration isn’t a prototype
> The first one can be resolved by changing pn_error() to pn_error(void) and the others can be fixed simply by adding some spacing. We typically just hack our local copies for testing, but we figured it may be better to get this into the main code stream if you guys can find the time to put it in.
> Cheers,
> Frank 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)