Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings for 0.6.0 release #321

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
PACKAGES="g++-arm-linux-gnueabihf" \
DEP_OPTS="NO_QT=1" \
GOAL="install" \
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" \
BITCOIN_CONFIG="--enable-reduce-exports" \
bash -xe ./build-test.sh

win64:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
PACKAGES="python3-zmq libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev systemtap-sdt-dev bpfcc-tools bpftrace" \
NO_DEPENDS=1 \
DEP_OPTS="NO_QT=1" \
RUN_TESTS=true \
RUN_TESTS=false \
RUN_BENCH=true \
DEBUD_MODE=true \
GOAL="install" \
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug" \
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports --enable-debug" \
CXXFLAGS="-g0 -O2" \
bash -xe ./build-test.sh

Expand All @@ -115,7 +115,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER" \
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER" \
bash -xe ./build-test.sh

linux-no-wallet:
Expand All @@ -133,7 +133,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" \
BITCOIN_CONFIG="--enable-reduce-exports" \
bash -xe ./build-test.sh

cross-mac_debug:
Expand All @@ -150,7 +150,7 @@ jobs:
OSX_SDK=10.14 \
GOAL="all deploy" \
DEBUD_MODE=true \
BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror CPPFLAGS=-DDEBUG " \
BITCOIN_CONFIG="--with-gui=qt5 --enable-reduce-exports --enable-werror CPPFLAGS=-DDEBUG " \
bash -xe ./build-test.sh
cross-mac_release:
name: Cross Mac Release
Expand All @@ -166,7 +166,7 @@ jobs:
OSX_SDK=10.14 \
GOAL="all deploy" \
DEBUD_MODE=false \
BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror" \
BITCOIN_CONFIG="--with-gui=qt5 --enable-reduce-exports --enable-werror" \
bash -xe ./build-test.sh

lint:
Expand Down
2 changes: 1 addition & 1 deletion build-aux/m4/tapyrus_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[
dnl enable qt support
AC_ARG_WITH([gui],
[AS_HELP_STRING([--with-gui@<:@=no|qt5|auto@:>@],
[build tapyrus_qt GUI (default=auto)])],
[build tapyrus_qt GUI (default=no)])],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

[
tapyrus_qt_want_version=$withval
if test "x$tapyrus_qt_want_version" = xyes; then
Expand Down
37 changes: 4 additions & 33 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ AC_ARG_ENABLE([lcov-branch-coverage],
[use_lcov_branch=yes],
[use_lcov_branch=no])

AC_ARG_ENABLE([glibc-back-compat],
[AS_HELP_STRING([--enable-glibc-back-compat],
[enable backwards compatibility with glibc])],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])

AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--enable-asm],
[Enable assembly routines (default is yes)])],
Expand Down Expand Up @@ -653,31 +647,8 @@ AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large
AX_GCC_FUNC_ATTRIBUTE([visibility])
AX_GCC_FUNC_ATTRIBUTE([dllexport])
AX_GCC_FUNC_ATTRIBUTE([dllimport])
AC_SEARCH_LIBS([clock_gettime],[rt])

if test x$use_glibc_compat != xno; then

#glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
#in anyway for back-compat.
AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing))

#__fdelt_chk's params and return type have changed from long unsigned int to long int.
# See which one is present here.
AC_MSG_CHECKING(__fdelt_chk type)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
#undef _FORTIFY_SOURCE
#endif
#define _FORTIFY_SOURCE 2
#include <sys/select.h>
extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
[ fdelt_type="long unsigned int"],
[ fdelt_type="long int"])
AC_MSG_RESULT($fdelt_type)
AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
else
AC_SEARCH_LIBS([clock_gettime],[rt])
fi

if test "x$enable_gprof" = xyes; then
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense,
Expand Down Expand Up @@ -1126,6 +1097,7 @@ if test x$have_miniupnpc = xno; then
if test x$use_upnp = xyes; then
AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
fi
use_upnp=no
AC_MSG_RESULT(no)
else
if test x$use_upnp != xno; then
Expand All @@ -1143,6 +1115,7 @@ else
MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
fi
else
use_upnp=no
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

AC_MSG_RESULT(no)
fi
fi
Expand Down Expand Up @@ -1219,7 +1192,6 @@ AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
Expand Down Expand Up @@ -1257,7 +1229,6 @@ AC_SUBST(DEBUG_CPPFLAGS)
AC_SUBST(WARN_CXXFLAGS)
AC_SUBST(NOWARN_CXXFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(COMPAT_LDFLAGS)
AC_SUBST(ERROR_CXXFLAGS)
AC_SUBST(GPROF_CXXFLAGS)
AC_SUBST(GPROF_LDFLAGS)
Expand Down Expand Up @@ -1370,7 +1341,7 @@ echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
echo " LDFLAGS = $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
echo " AR = $AR"
echo " ARFLAGS = $ARFLAGS"
echo
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm"
HOST_CFLAGS="-O2 -g"
Expand Down
1 change: 0 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ parts:
configflags:
- --disable-dependency-tracking
- --enable-zmq
- --enable-glibc-back-compat
- --enable-reduce-exports
- --with-gui=no
- --with-incompatible-bdb
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ add_subdirectory(univalue)
# Various completely unrelated features shared by all executables.
add_library(util
clientversion.cpp
compat/glibc_sanity.cpp
compat/glibcxx_sanity.cpp
compat/strnlen.cpp
fs.cpp
logging.cpp
Expand Down
17 changes: 0 additions & 17 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ BITCOIN_CORE_H = \
compat/byteswap.h \
compat/cpuid.h \
compat/endian.h \
compat/sanity.h \
compressor.h \
consensus/consensus.h \
consensus/tx_verify.h \
Expand Down Expand Up @@ -411,8 +410,6 @@ libtapyrus_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libtapyrus_util_a_SOURCES = \
support/lockedpool.cpp \
clientversion.cpp \
compat/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \
compat/strnlen.cpp \
fs.cpp \
interfaces/handler.cpp \
Expand All @@ -429,11 +426,6 @@ libtapyrus_util_a_SOURCES = \
utiltime.cpp \
$(BITCOIN_CORE_H)

if GLIBC_BACK_COMPAT
libtapyrus_util_a_SOURCES += compat/glibc_compat.cpp
AM_LDFLAGS += $(COMPAT_LDFLAGS)
endif

# cli: shared between tapyrus-cli and tapyrus-qt
libtapyrus_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libtapyrus_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
Expand Down Expand Up @@ -542,11 +534,6 @@ if BUILD_BITCOIN_LIBS
include_HEADERS = script/tapyrusconsensus.h
include_HEADERS += coloridentifier.h
libtapyrusconsensus_la_SOURCES = $(crypto_libtapyrus_crypto_base_a_SOURCES) $(libtapyrus_consensus_a_SOURCES)

if GLIBC_BACK_COMPAT
libtapyrusconsensus_la_SOURCES += compat/glibc_compat.cpp
endif

libtapyrusconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libtapyrusconsensus_la_LIBADD = $(LIBSECP256K1) $(BOOST_SYSTEM_LIB)
libtapyrusconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
Expand Down Expand Up @@ -600,10 +587,6 @@ clean-local:
$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@

check-symbols: $(bin_PROGRAMS)
if GLIBC_BACK_COMPAT
@echo "Checking glibc back compat..."
$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py $(bin_PROGRAMS)
endif

check-security: $(bin_PROGRAMS)
if HARDEN
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ test_test_tapyrus_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_C
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
test_test_tapyrus_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_tapyrus_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(MINIUPNPC_LIBS)
test_test_tapyrus_LDADD += $(BDB_LIBS) $(MINIUPNPC_LIBS)
test_test_tapyrus_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -static

if ENABLE_ZMQ
Expand Down
6 changes: 4 additions & 2 deletions src/bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef BITCOIN_BENCH_BENCH_H
#define BITCOIN_BENCH_BENCH_H

#include <fs.h>

#include <functional>
#include <limits>
#include <map>
Expand Down Expand Up @@ -130,7 +132,7 @@ class PlotlyPrinter : public Printer
int64_t m_width;
int64_t m_height;
};
}
} //namespace benchmark


// BENCHMARK(foo, num_iters_for_one_second) expands to: benchmark::BenchRunner bench_11foo("foo", num_iterations);
Expand All @@ -146,6 +148,6 @@ const std::string SIGN_BLOCK_PUBKEY("03af80b90d25145da28c583359beb47b21796b2fe1a

const std::string SIGN_BLOCK_PRIVKEY("cUJN5RVzYWFoeY8rUztd47jzXCu1p57Ay8V7pqCzsBD3PEXN7Dd4");

void writeTestGenesisBlockToFile(boost::filesystem::path genesisPath);
void writeTestGenesisBlockToFile(fs::path genesisPath);

#endif // BITCOIN_BENCH_BENCH_H
2 changes: 1 addition & 1 deletion src/bench/bench_tapyrus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void SetupBenchArgs()

static fs::path SetDataDir()
{
fs::path ret = fs::temp_directory_path() / "bench_tapyrus" / fs::unique_path();
fs::path ret = fs::temp_directory_path() / "bench_tapyrus" / "lock_path";
fs::create_directories(ret);
gArgs.ForceSetArg("-datadir", ret.string());
return ret;
Expand Down
5 changes: 5 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <chainparams.h>
#include <chainparamsseeds.h>
#include <tinyformat.h>
#include <util.h>
#include <assert.h>
Expand Down Expand Up @@ -47,6 +48,8 @@ class CProductionChainParams : public CChainParams {

/* disable fallback fee on mainnet */
m_fallback_fee_enabled = false;
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));

}
};

Expand Down Expand Up @@ -76,6 +79,8 @@ class CDevelopmentChainParams : public CChainParams {

/* enable fallback fee on dev */
m_fallback_fee_enabled = true;
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));

}
};

Expand Down
2 changes: 2 additions & 0 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CChainParams
const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
int GetRPCPort() const { return rpcPort; }
int GetDefaultPort() const { return nDefaultPort; }
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
protected:
//require signedblockpubkey argument only in tapyrusd
CChainParams() {}
Expand All @@ -86,6 +87,7 @@ class CChainParams
CCheckpointData checkpointData;
ChainTxData chainTxData;
bool m_fallback_fee_enabled;
std::vector<SeedSpec6> vFixedSeeds;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/coloridentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ ColorIdentifier GetColorIdFromScript(const CScript& script)

CKeyID CColorKeyID::getKeyID() const
{
return std::move( CKeyID( uint160( std::vector<unsigned char>(this->begin(), this->end()))));
return CKeyID( uint160( std::vector<unsigned char>(this->begin(), this->end())));
}
Loading