Skip to content

compiler support? #4

@WallStProg

Description

@WallStProg

Curious what compilers you're using. I'm trying to build on CentOS 7 with gcc 5.3.0 and clang 8.0.0 and both give (different) compile errors.

gcc

In file included from ../src/allocator_tester.h:54:0,
                 from ../src/allocator_tester.cpp:35:
../src/void_allocator.h: In member function \u2018void* VoidAllocatorForTest<ActualAllocator>::allocateSlots(size_t)\u2019:
../src/void_allocator.h:60:60: error: expected \u2018,\u2019 before \u2018)\u2019 token
  void* allocateSlots( size_t sz ) { static_assert( isFake()); assert( sz <= fakeBufferSize ); return alloc.allocate( sz ); }
                                                            ^
../src/void_allocator.h:60:60: error: expected string-literal before \u2018)\u2019 token
In file included from ../src/allocator_tester.cpp:35:0:
../src/allocator_tester.h: In function \u2018void randomPos_RandomSize(AllocatorUnderTest&, size_t, size_t, size_t, size_t, size_t)\u2019:
../src/allocator_tester.h:285:5: error: expected \u2018(\u2019 before \u2018constexpr\u2019
  if constexpr ( !allocatorUnderTest.isFake() )
     ^
../src/allocator_tester.h:287:2: error: \u2018else\u2019 without a previous \u2018if\u2019
  else
  ^
../src/allocator_tester.h:306:8: error: expected \u2018(\u2019 before \u2018constexpr\u2019
     if constexpr ( doMemAccess )
        ^
../src/allocator_tester.cpp:185:1: error: expected \u2018}\u2019 at end of input
 }
 ^
../src/allocator_tester.cpp:185:1: error: expected \u2018}\u2019 at end of input
../src/allocator_tester.cpp:185:1: error: expected \u2018}\u2019 at end of input

clang

btorpey@bt-brix build]$ ./build_gcc.sh
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:46:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<NewDeleteAllocatorForTest, none>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::none>( allocator, testParams->startupParams.iterCount, test...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization 'runRandomTest<NewDeleteAllocatorForTest>'
      requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:135:3: note: in instantiation of function template specialization 'runTest<NewDeleteAllocatorForTest>'
      requested here
                runTest<MyAllocatorT>( &params );
                ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:49:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<NewDeleteAllocatorForTest, full>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::full>( allocator, testParams->startupParams.iterCount, test...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization 'runRandomTest<NewDeleteAllocatorForTest>'
      requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:135:3: note: in instantiation of function template specialization 'runTest<NewDeleteAllocatorForTest>'
      requested here
                runTest<MyAllocatorT>( &params );
                ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:52:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<NewDeleteAllocatorForTest, single>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::single>( allocator, testParams->startupParams.iterCount, te...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization 'runRandomTest<NewDeleteAllocatorForTest>'
      requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:135:3: note: in instantiation of function template specialization 'runTest<NewDeleteAllocatorForTest>'
      requested here
                runTest<MyAllocatorT>( &params );
                ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:55:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<NewDeleteAllocatorForTest, check>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::check>( allocator, testParams->startupParams.iterCount, tes...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization 'runRandomTest<NewDeleteAllocatorForTest>'
      requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:135:3: note: in instantiation of function template specialization 'runTest<NewDeleteAllocatorForTest>'
      requested here
                runTest<MyAllocatorT>( &params );
                ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:46:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<VoidAllocatorForTest<NewDeleteAllocatorForTest>, none>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::none>( allocator, testParams->startupParams.iterCount, test...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization
      'runRandomTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:141:4: note: in instantiation of function template specialization
      'runTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                        runTest<VoidAllocatorForTest<MyAllocatorT>>( &params );
                        ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:49:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<VoidAllocatorForTest<NewDeleteAllocatorForTest>, full>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::full>( allocator, testParams->startupParams.iterCount, test...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization
      'runRandomTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:141:4: note: in instantiation of function template specialization
      'runTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                        runTest<VoidAllocatorForTest<MyAllocatorT>>( &params );
                        ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:52:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<VoidAllocatorForTest<NewDeleteAllocatorForTest>, single>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::single>( allocator, testParams->startupParams.iterCount, te...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization
      'runRandomTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:141:4: note: in instantiation of function template specialization
      'runTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                        runTest<VoidAllocatorForTest<MyAllocatorT>>( &params );
                        ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:257:258: warning: format specifies type 'unsigned long long' but the argument has type 'size_t'
      (aka 'unsigned long') [-Wformat]
  ...[rnd_seed = %llu] ...\n", threadID, allocatorUnderTest.name(), maxItemSizeExp, maxItems, iterCount, memAccessTypeStr, rnd_seed );
                 ~~~~                                                                                                      ^~~~~~~~
                 %zu
../src/allocator_tester.cpp:55:4: note: in instantiation of function template specialization
      'randomPos_RandomSize<VoidAllocatorForTest<NewDeleteAllocatorForTest>, check>' requested here
                        randomPos_RandomSize<Allocator,MEM_ACCESS_TYPE::check>( allocator, testParams->startupParams.iterCount, tes...
                        ^
../src/allocator_tester.cpp:83:19: note: in instantiation of function template specialization
      'runRandomTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                std::thread t1( runRandomTest<Allocator>, (void*)(testParams + i) );
                                ^
../src/allocator_tester.cpp:141:4: note: in instantiation of function template specialization
      'runTest<VoidAllocatorForTest<NewDeleteAllocatorForTest> >' requested here
                        runTest<VoidAllocatorForTest<MyAllocatorT>>( &params );
                        ^
In file included from ../src/allocator_tester.cpp:35:
../src/allocator_tester.h:285:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
../src/allocator_tester.h:434:18: error: constexpr if condition is not a constant expression
        if constexpr ( !allocatorUnderTest.isFake() )
                        ^
8 warnings and 16 errors generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions