scons: Disable some warnings in clang.
authorGabe Black <gabeblack@google.com>
Mon, 10 Feb 2020 04:03:58 +0000 (20:03 -0800)
committerGabe Black <gabeblack@google.com>
Mon, 25 May 2020 23:17:14 +0000 (23:17 +0000)
The defaulted-function-deleted warning triggers in generated code which
would be very tricky to address.

The c99-designator refers to using an array index to specify which
element of an array is being initialized. This makes the code more
clear and is supported by both g++ and clang++. Designated initializers
for structures are being introduced in C++20, but there is no word I
could find on arrays. This warning option seems to only exist in clang
versions 10 and up, so we can only use it on those versions.

Change-Id: I8fb858e643814638c552a49336db2672be8e43c8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29396
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
SConstruct

index 82fad3b957c9c78af1bd97c4baf645097c5a9649..142800e60620eb4a45a2cb3b98c486d7c5830c39 100755 (executable)
@@ -475,7 +475,10 @@ elif main['CLANG']:
                          # use struct hash and class hash
                          # interchangeably.
                          '-Wno-mismatched-tags',
+                         '-Wno-defaulted-function-deleted',
                          ])
+    if compareVersions(clang_version, "10.0") >= 0:
+        main.Append(CCFLAGS=['-Wno-c99-designator'])
 
     main.Append(TCMALLOC_CCFLAGS=['-fno-builtin'])