| author | |
| committer | |
| log | c5509a07cacfea16b4fb3c8d552a33083b713697 |
| tree | 00e415b1b9252810b5b39f0b5cbcfd5879379388 |
| parent | 004c383292412faef7987b5fb5da73a2971176ee |
On Arch Linux the current default compiler is gcc 8.2.1 and this change
is needed to ignore the following errors:
In file included from /home/wink/local/include/llvm/ADT/STLExtras.h:21,
from /home/wink/local/include/llvm/ADT/StringRef.h:13,
from /home/wink/local/include/llvm/ADT/StringMap.h:17,
from /home/wink/local/include/llvm/Support/Host.h:17,
from /home/wink/local/include/llvm/ADT/Hashing.h:49,
from /home/wink/local/include/llvm/ADT/ArrayRef.h:13,
from /home/wink/local/include/llvm/ADT/APFloat.h:21,
from /home/wink/local/include/clang/AST/APValue.h:18,
from /home/wink/local/include/clang/AST/Decl.h:17,
from /home/wink/local/include/clang/AST/ASTTypeTraits.h:20,
from /home/wink/local/include/clang/AST/ASTContext.h:18,
from /home/wink/local/include/clang/Frontend/ASTUnit.h:18,
from /home/wink/prgs/ziglang/zig/src/translate_c.cpp:18:
/home/wink/local/include/llvm/ADT/SmallVector.h: In instantiation of ‘void llvm::SmallVectorTemplateBase<T, true>::push_back(const T&) [with T = std::pair<void*, long unsigned int>]’:
/home/wink/local/include/llvm/Support/Allocator.h:249:33: required from ‘void* llvm::BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold>::Allocate(size_t, size_t) [with AllocatorT = llvm::MallocAllocator; long unsigned int SlabSize = 4096; long unsigned int SizeThreshold = 4096; size_t = long unsigned int]’
/home/wink/local/include/clang/AST/ASTContext.h:659:42: required from here
/home/wink/local/include/llvm/ADT/SmallVector.h:313:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<void*, long unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
memcpy(this->end(), &Elt, sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8.2.1/utility:70,
from /home/wink/local/include/llvm/Support/type_traits.h:19,
from /home/wink/local/include/llvm/Support/Casting.h:19,
from /home/wink/local/include/clang/Basic/LLVM.h:22,
from /home/wink/local/include/clang/AST/APValue.h:17,
from /home/wink/local/include/clang/AST/Decl.h:17,
from /home/wink/local/include/clang/AST/ASTTypeTraits.h:20,
from /home/wink/local/include/clang/AST/ASTContext.h:18,
from /home/wink/local/include/clang/Frontend/ASTUnit.h:18,
from /home/wink/prgs/ziglang/zig/src/translate_c.cpp:18:
/usr/include/c++/8.2.1/bits/stl_pair.h:198:12: note: ‘struct std::pair<void*, long unsigned int>’ declared here
struct pair
^~~~2 files changed, 18 insertions(+), 0 deletions(-)
src/translate_c.cpp+9| ... | @@ -15,10 +15,19 @@ | ... | @@ -15,10 +15,19 @@ |
| 15 | #include "parser.hpp" | 15 | #include "parser.hpp" |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | #if __GNUC__ >= 8 | ||
| 19 | #pragma GCC diagnostic push | ||
| 20 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | ||
| 21 | #endif | ||
| 22 | |||
| 18 | #include <clang/Frontend/ASTUnit.h> | 23 | #include <clang/Frontend/ASTUnit.h> |
| 19 | #include <clang/Frontend/CompilerInstance.h> | 24 | #include <clang/Frontend/CompilerInstance.h> |
| 20 | #include <clang/AST/Expr.h> | 25 | #include <clang/AST/Expr.h> |
| 21 | 26 | ||
| 27 | #if __GNUC__ >= 8 | ||
| 28 | #pragma GCC diagnostic pop | ||
| 29 | #endif | ||
| 30 | |||
| 22 | #include <string.h> | 31 | #include <string.h> |
| 23 | 32 | ||
| 24 | using namespace clang; | 33 | using namespace clang; |
src/zig_llvm.cpp+9| ... | @@ -15,6 +15,11 @@ | ... | @@ -15,6 +15,11 @@ |
| 15 | 15 | ||
| 16 | #include "zig_llvm.h" | 16 | #include "zig_llvm.h" |
| 17 | 17 | ||
| 18 | #if __GNUC__ >= 8 | ||
| 19 | #pragma GCC diagnostic push | ||
| 20 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | ||
| 21 | #endif | ||
| 22 | |||
| 18 | #include <llvm/Analysis/TargetLibraryInfo.h> | 23 | #include <llvm/Analysis/TargetLibraryInfo.h> |
| 19 | #include <llvm/Analysis/TargetTransformInfo.h> | 24 | #include <llvm/Analysis/TargetTransformInfo.h> |
| 20 | #include <llvm/IR/DIBuilder.h> | 25 | #include <llvm/IR/DIBuilder.h> |
| ... | @@ -42,6 +47,10 @@ | ... | @@ -42,6 +47,10 @@ |
| 42 | 47 | ||
| 43 | #include <lld/Common/Driver.h> | 48 | #include <lld/Common/Driver.h> |
| 44 | 49 | ||
| 50 | #if __GNUC__ >= 8 | ||
| 51 | #pragma GCC diagnostic pop | ||
| 52 | #endif | ||
| 53 | |||
| 45 | #include <new> | 54 | #include <new> |
| 46 | 55 | ||
| 47 | #include <stdlib.h> | 56 | #include <stdlib.h> |