qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marko Kohtala (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (QPID-7709) Problem building on Fedora rawhide
Date Wed, 07 Aug 2019 08:28:00 GMT

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

Marko Kohtala edited comment on QPID-7709 at 8/7/19 8:27 AM:
-------------------------------------------------------------

It is not the clearest error message, but after some more look I did spot the error in the
code. You can not do {{s[1]}} on {{s}} that might be empty.

{code:cpp}
$ cat test.cpp
#include <string>
char foo() {
    std::string s("");
    return s[1];
}
$ c++ -c -Wall -O3 test.cpp
test.cpp: In function ‘char foo()’:
test.cpp:4:15: warning: ‘*((void*)& s +17)’ is used uninitialized in this function
[-Wuninitialized]
     return s[1];
{code}


was (Author: kohtala):
It is not the clearest error message, but after some more look I did spot the error in the
code. You can not do `s[1]` on `s` that might be empty.
{code:java}
$ cat test.cpp
#include <string>
char foo() {
    std::string s("");
    return s[1];
}
$ c++ -c -Wall -O3 test.cpp
test.cpp: In function ‘char foo()’:
test.cpp:4:15: warning: ‘*((void*)& s +17)’ is used uninitialized in this function
[-Wuninitialized]
     return s[1];

{code}

> Problem building on Fedora rawhide
> ----------------------------------
>
>                 Key: QPID-7709
>                 URL: https://issues.apache.org/jira/browse/QPID-7709
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: qpid-python-1.35.0
>         Environment: Fedora rawhide
>            Reporter: Irina Boverman
>            Priority: Major
>
> Fails to build in Fedora rawhide:
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/Selector.cpp: In member function
'const qpid::broker::Value qpid::broker::MessageSelectorEnv::specialValue(const string&)
const':
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/Selector.cpp:169:11: error: 'v'
may be used uninitialized in this function [-Werror=maybe-uninitialized]
>          v = Value();
>          ~~^~~~~~~~~
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp: In member
function 'qpid::broker::Expression* qpid::broker::Parse::orExpression(qpid::broker::Tokeniser&)':
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> cc1plus: all warnings being treated as errors
> make[2]: *** [src/CMakeFiles/qpidbroker.dir/build.make:3234: src/CMakeFiles/qpidbroker.dir/qpid/broker/Selector.cpp.o]
Error 1
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp: In member
function 'qpid::broker::Expression* qpid::broker::Parse::unaryArithExpression(qpid::broker::Tokeniser&)':
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> /builddir/build/BUILD/qpid-cpp-1.35.0/src/qpid/broker/SelectorExpression.cpp:1041:13:
error: '*((void*)& s +17)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (s[1]=='b' || s[1]=='B') {
> cc1plus: all warnings being treated as errors
> make[2]: *** [src/CMakeFiles/qpidbroker.dir/build.make:3258: src/CMakeFiles/qpidbroker.dir/qpid/broker/SelectorExpression.cpp.o]
Error 1



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message