Compiling gui with clang fails with "Wreturn-stack-address" #14762

issue MarcoFalke opened this issue on November 19, 2018
  1. MarcoFalke commented at 6:54 PM on November 19, 2018: member

    Steps to reproduce on xenial (or probably bionic as well):

    apt update && apt install curl wget htop git vim ccache  build-essential libtool autotools-dev automake pkg-config bsdmainutils libssl-dev libevent-dev libboost-all-dev clang libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libdb5.3++-dev -y
    git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin && git checkout master
    ./autogen.sh && ./configure --with-incompatible-bdb CC=clang CXX=clang++ && make -j 9
    
    Making all in src
    make[1]: Entering directory '/bitcoin/bitcoin/bitcoin/bitcoin/src'
    make[2]: Entering directory '/bitcoin/bitcoin/bitcoin/bitcoin/src'
    make[3]: Entering directory '/bitcoin/bitcoin/bitcoin/bitcoin'
    make[3]: Leaving directory '/bitcoin/bitcoin/bitcoin/bitcoin'
      CXX      qt/qt_libbitcoinqt_a-walletframe.o
      CXX      libbitcoin_util_a-clientversion.o
    In file included from qt/walletframe.cpp:5:
    In file included from ./qt/walletframe.h:9:
    In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMap:1:
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qmap.h:617:27: warning: returning address of local temporary object [-Wreturn-stack-address]
        return n ? n->value : adefaultValue;
                              ^~~~~~~~~~~~~
    qt/walletframe.cpp:85:45: note: in instantiation of member function 'QMap<QString, WalletView *>::value' requested here
        WalletView *walletView = mapWalletViews.value(name);
                                                ^
    /usr/include/x86_64-linux-gnu/qt5/QtCore/qmap.h:386:44: note: binding reference variable 'adefaultValue' here
        const T value(const Key &key, const T &defaultValue = T()) const;
                                               ^              ~~~
    
  2. MarcoFalke closed this on Nov 19, 2018

  3. MarcoFalke commented at 7:44 PM on November 19, 2018: member

    Doesn't happen on bionic, so closing for now.

  4. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me