Bobby R. Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/29294 )

Change subject: misc,sim: Fixed std::array bracket compiler error
......................................................................

misc,sim: Fixed std::array bracket compiler error

For versions of Clang before 6.0, Clang returns an error if and
std::array initialization is not encompassed in two sets of
encompassing braces. This is a known compiler bug:
https://bugs.llvm.org/show_bug.cgi?id=21629.

As we support Clang 3.9 onwards, we are required to include these
redundant braces to ensure compilation. They do not produce any
ill-effects when using later clang compilers or with any GCC compiler
gem5 presently supports.

Change-Id: Ia512a9b9f583b1cfa28f9fc4c24f6e202e46b4cb
Issue-on: https://gem5.atlassian.net/browse/GEM5-563
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29294
Reviewed-by: Pouya Fotouhi <pfoto...@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/arm/semihosting.cc
M src/sim/pseudo_inst.cc
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Pouya Fotouhi: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/semihosting.cc b/src/arch/arm/semihosting.cc
index 7711a86..a7a4d2a 100644
--- a/src/arch/arm/semihosting.cc
+++ b/src/arch/arm/semihosting.cc
@@ -581,10 +581,10 @@
     uint64_t heap_base, heap_limit, stack_base, stack_limit;
gatherHeapInfo(tc, false, heap_base, heap_limit, stack_base, stack_limit);

-    std::array<uint32_t, 4> block = {
+    std::array<uint32_t, 4> block = {{
         (uint32_t)heap_base, (uint32_t)heap_limit,
         (uint32_t)stack_base, (uint32_t)stack_limit
-    };
+    }};
     portProxy(tc).write(block_addr, block, ArmISA::byteOrder(tc));

     return retOK(0);
@@ -596,9 +596,9 @@
     uint64_t heap_base, heap_limit, stack_base, stack_limit;
gatherHeapInfo(tc, true, heap_base, heap_limit, stack_base, stack_limit);

-    std::array<uint64_t, 4> block = {
+    std::array<uint64_t, 4> block = {{
         heap_base, heap_limit, stack_base, stack_limit
-    };
+    }};
     portProxy(tc).write(block_addr, block, ArmISA::byteOrder(tc));

     return retOK(0);
diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc
index b11a5a4..203afc0 100644
--- a/src/sim/pseudo_inst.cc
+++ b/src/sim/pseudo_inst.cc
@@ -285,7 +285,7 @@
     char key[len];
     memset(key, '\0', len);

-    std::array<uint64_t, 2> key_regs = { key_str1, key_str2 };
+    std::array<uint64_t, 2> key_regs = {{ key_str1, key_str2 }};
     key_regs = letoh(key_regs);
     memcpy(key, key_regs.data(), sizeof(key_regs));


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29294
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v20.0.0.0
Gerrit-Change-Id: Ia512a9b9f583b1cfa28f9fc4c24f6e202e46b4cb
Gerrit-Change-Number: 29294
Gerrit-PatchSet: 3
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Pouya Fotouhi <pfoto...@ucdavis.edu>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to