[clamav-users] Can't compile under gcc 7.2.0
Frans de Boer
frans at fransdb.nl
Sat Jan 27 11:30:09 UTC 2018
On the current OpenSuSE Tumbleweed, I get:
In file included from
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:17:0,
from
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:18,
from
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp:41:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/AlignOf.h:
At global scope:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/AlignOf.h:57:24:
error: expected unqualified-id before ‘alignof’
static inline unsigned alignof() { return AlignOf<T>::Alignment; }
^~~~~~~
In file included from
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:18:0,
from
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp:41:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:
In member function ‘void llvm::SpecificBumpPtrAllocator<T>::DestroyAll()’:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:204:46:
error: expected primary-expression before ‘<’ token
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
^
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:204:39:
warning: ISO C++ does not allow ‘alignof’ with a non-type [-Wpedantic]
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
^~~~~~~
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:204:48:
error: expected primary-expression before ‘>’ token
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
^
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/Allocator.h:204:50:
error: expected primary-expression before ‘)’ token
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
^
In file included from
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp:41:0:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:
In static member function ‘static llvm::StringMapEntry<ValueTy>*
llvm::StringMapEntry<ValueTy>::Create(const char*, const char*,
AllocatorTy&, InitType)’:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:170:33:
error: expected primary-expression before ‘<’ token
unsigned Alignment = alignof<StringMapEntry>();
^
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:170:26:
warning: ISO C++ does not allow ‘alignof’ with a non-type [-Wpedantic]
unsigned Alignment = alignof<StringMapEntry>();
^~~~~~~
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:170:48:
error: expected primary-expression before ‘>’ token
unsigned Alignment = alignof<StringMapEntry>();
^
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/ADT/StringMap.h:170:50:
error: expected primary-expression before ‘)’ token
unsigned Alignment = alignof<StringMapEntry>();
^
In file included from
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp:69:0:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/CommandLine.h:
In member function ‘void llvm::cl::alias::done()’:
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/CommandLine.h:1326:5:
warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (AliasFor == 0)
^~
../../../clamav-0.99.3/libclamav/c++/llvm/include/llvm/Support/CommandLine.h:1328:7:
note: ...this statement, but the latter is misleadingly indented as if
it were guarded by the ‘if’
addArgument();
^~~~~~~~~~~
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp: In function
‘void setGuard(unsigned char*)’:
../../../clamav-0.99.3/libclamav/c++/bytecode2llvm.cpp:2432:49: warning:
ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
cl_hash_data("md5", salt, 48, guardbuf, NULL);
^
make[5]: *** [Makefile:2070: libclamavcxx_la-bytecode2llvm.lo] Error 1
make[5]: Leaving directory
'/mnt/raidarray/fdb-data/projects/linux/security/clamav/clamav-build/libclamav/c++'
make[4]: *** [Makefile:1469: all] Error 2
make[4]: Leaving directory
'/mnt/raidarray/fdb-data/projects/linux/security/clamav/clamav-build/libclamav/c++'
make[3]: *** [Makefile:3376: all-recursive] Error 1
make[3]: Leaving directory
'/mnt/raidarray/fdb-data/projects/linux/security/clamav/clamav-build/libclamav'
make[2]: *** [Makefile:1089: all] Error 2
make[2]: Leaving directory
'/mnt/raidarray/fdb-data/projects/linux/security/clamav/clamav-build/libclamav'
make[1]: *** [Makefile:675: all-recursive] Error 1
make[1]: Leaving directory
'/mnt/raidarray/fdb-data/projects/linux/security/clamav/clamav-build'
make: *** [Makefile:503: all] Error 2
--------------------------------------------------------------------
Compiling on the same and also different machines with gcc 4.8.3 works
correctly. Looking at the messages it seems to me that gcc 7.2.0 is more
strict.
Also, this behaviour was also in rc1/2 of 0.99.3.
Am I the only one?
Regards,
Frans.
More information about the clamav-users
mailing list