Git Product home page Git Product logo

Comments (12)

dcousens avatar dcousens commented on August 27, 2024 2
~$ g++ --version
g++ (GCC) 7.2.1 20171128
Copyright (C) 2017 Free Software Foundation, Inc.

static_assert ( bool_constexpr , message ) |   | (since C++11)
static_assert ( bool_constexpr ) |   | (since C++17)

Probably a syntax error as C++17 has message optional, and your g++ version doesn't have C++17 support.

A PR is welcome to add a message in there to enable your compiler support 👍

from fast-dat-parser.

Voelundr avatar Voelundr commented on August 27, 2024 1

Update from g++ 7.2.0 to g++ 7.3.0 Now the Errors are:

g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/parser.cpp -o src/parser.o
In file included from include/hash.hpp:8:0,
from include/bitcoin.hpp:9,
from src/parser.cpp:9:
include/ranger.hpp: In instantiation of ‘void __ranger::Range::put(E) [with E = __ranger::Range<const char*>; I = unsigned char*]’:
include/bitcoin.hpp:251:44: required from ‘void putASM(R&, const R&) [with R = __ranger::Range<unsigned char*>]’
src/statistics.hpp:110:11: required from ‘void dumpASM::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1: required from here
include/ranger.hpp:86:32: error: no matching function for call to ‘put(__ranger::Range<unsigned char*>&, __ranger::Range<const char*>&)’
void put (E e) { __ranger::put(this, e); }
~~~~~~~~~~~~~^~~~~~~~~~
include/ranger.hpp:23:6: note: candidate: void __ranger::put(R&, typename R::value_type) [with R = __ranger::Range<unsigned char
>; typename R::value_type = unsigned char]
void put (R& r, typename R::value_type e) {
^~~
include/ranger.hpp:23:6: note: no known conversion for argument 2 from ‘__ranger::Range<const char*>’ to ‘__ranger::Range<unsigned char*>::value_type {aka unsigned char}’
include/ranger.hpp:36:6: note: candidate: template<class R, class E, class V> void __ranger::put(R&, E)
void put (R& r, E e) {
^~~
include/ranger.hpp:36:6: note: template argument deduction/substitution failed:
include/ranger.hpp:31:2: error: no type named ‘type’ in ‘struct std::enable_if<false, __ranger::Range<const char*> >’
typename V = typename std::enable_if<
^~~~~~~~
In file included from include/bitcoin.hpp:9:0,
from src/parser.cpp:9:
include/hash.hpp:58:7: error: ‘auto {anonymous}::toHexBE(const uint256_t&)’ defined but not used [-Werror=unused-function]
auto toHexBE (const uint256_t& hash) {
^~~~~~~
cc1plus: all warnings being treated as errors
Makefile:28: recipe for target 'src/parser.o' failed
make: *** [src/parser.o] Error 1

from fast-dat-parser.

dcousens avatar dcousens commented on August 27, 2024 1

Can reproduce... will fix

from fast-dat-parser.

dcousens avatar dcousens commented on August 27, 2024

What version g++?

from fast-dat-parser.

scriptzteam avatar scriptzteam commented on August 27, 2024
g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609

:)

from fast-dat-parser.

dcousens avatar dcousens commented on August 27, 2024

Resolved in master, see #12, and dcousens/ranger@aa3b771

from fast-dat-parser.

Voelundr avatar Voelundr commented on August 27, 2024

g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/parser.cpp -o src/parser.o
In file included from include/hash.hpp:8:0,
from include/bitcoin.hpp:9,
from src/parser.cpp:9:
include/ranger.hpp: In instantiation of ‘void __ranger::Range::put(E) [with E = __ranger::Range<const char*>; I = unsigned char*]’:
include/bitcoin.hpp:251:44: required from ‘void putASM(R&, const R&) [with R = __ranger::Range<unsigned char*>]’
src/statistics.hpp:110:11: required from ‘void dumpASM::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1: required from here
include/ranger.hpp:86:32: error: no matching function for call to ‘put(__ranger::Range<unsigned char*>&, __ranger::Range<const char*>&)’
void put (E e) { __ranger::put(this, e); }
~~~~~~~~~~~~~^~~~~~~~~~
include/ranger.hpp:23:6: note: candidate: void __ranger::put(R&, typename R::value_type) [with R = __ranger::Range<unsigned char
>; typename R::value_type = unsigned char]
void put (R& r, typename R::value_type e) {
^~~
include/ranger.hpp:23:6: note: no known conversion for argument 2 from ‘__ranger::Range<const char*>’ to ‘__ranger::Range<unsigned char*>::value_type {aka unsigned char}’
include/ranger.hpp:36:6: note: candidate: template<class R, class E, class V> void __ranger::put(R&, E)
void put (R& r, E e) {
^~~
include/ranger.hpp:36:6: note: template argument deduction/substitution failed:
include/ranger.hpp:31:2: error: no type named ‘type’ in ‘struct std::enable_if<false, __ranger::Range<const char*> >’
typename V = typename std::enable_if<
^~~~~~~~
In file included from include/bitcoin.hpp:9:0,
from src/parser.cpp:9:
include/hash.hpp:58:7: error: ‘auto {anonymous}::toHexBE(const uint256_t&)’ defined but not used [-Werror=unused-function]
auto toHexBE (const uint256_t& hash) {
^~~~~~~
cc1plus: all warnings being treated as errors
Makefile:28: recipe for target 'src/parser.o' failed
make: *** [src/parser.o] Error 1

from fast-dat-parser.

369pie avatar 369pie commented on August 27, 2024

i got the error, too . gcc 7.3

from fast-dat-parser.

dcousens avatar dcousens commented on August 27, 2024

@efvhi you are building from master?

from fast-dat-parser.

scriptzteam avatar scriptzteam commented on August 27, 2024

Great cant wait for it :)

from fast-dat-parser.

noolua avatar noolua commented on August 27, 2024

On ubuntu 16.04 with g++ 5.4.0, try this

diff --git a/Makefile b/Makefile
index ebe06fe..3e5f32a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CXX=g++
-CFLAGS=-pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings
+CFLAGS=-pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Wextra -Wwrite-strings
 #OFLAGS=-O3 -ggdb3
 OFLAGS=-O3
 LFLAGS=-lcrypto
diff --git a/include/ranger.hpp b/include/ranger.hpp
index fceceb8..f71df28 100644
--- a/include/ranger.hpp
+++ b/include/ranger.hpp
@@ -149,7 +149,8 @@ auto ptr_range (R& r) {
        return __ranger::Range<pointer>(r.data(), r.data() + r.size());
 }
 
-inline auto zstr_range (const char* z) {
+inline auto zstr_range (const char* z_) {
+       auto z = reinterpret_cast<const unsigned char*>(z_);
        using pointer = decltype(z);
 
        auto r = z;
diff --git a/src/parser.cpp b/src/parser.cpp
index 48af06b..dbe4c7c 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -15,6 +15,11 @@
 #include "statistics.hpp"
 // #include "leveldb.hpp"
 
+#ifndef __cpp_if_constexpr
+template <typename Block>
+constexpr decltype(dumpUnspents<Block>::BLANK_TXIN) dumpUnspents<Block>::BLANK_TXIN;
+#endif
+
 using backing_vector_t = std::vector<uint8_t>;
 using block_t = decltype(Block(ptr_range(backing_vector_t()), ptr_range(backing_vector_t())));
 using thread_function_t = std::function<void(void)>;

from fast-dat-parser.

dcousens avatar dcousens commented on August 27, 2024

Duplicate of #15 - which is fixed

from fast-dat-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.