From 4b3df5c8882a687577b715dcb7a24a0a2beb9121 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 3 Dec 2024 16:30:26 +0100 Subject: [PATCH] Revert "base: prevent -Warray-bounds warnings in memcpy_cpu" This reverts commit 3d6c22d08f71d439d2ac66858ba24c5d39e86762. --- repos/base/include/cpu/string.h | 4 ---- repos/base/include/util/string.h | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/repos/base/include/cpu/string.h b/repos/base/include/cpu/string.h index 2a6a6bbff89..898b0a9b57a 100644 --- a/repos/base/include/cpu/string.h +++ b/repos/base/include/cpu/string.h @@ -25,11 +25,7 @@ namespace Genode { * \param size number of bytes to copy * * \return number of bytes not copied - * - * The compiler attribute is needed to prevent -Warray-bound warnings - * with gcc 12.3. */ - __attribute((optimize("no-tree-loop-distribute-patterns"))) inline size_t memcpy_cpu(void * dst, const void * src, size_t size) { using word_t = unsigned long; diff --git a/repos/base/include/util/string.h b/repos/base/include/util/string.h index 0ca65d2ddd2..af2a438d2b0 100644 --- a/repos/base/include/util/string.h +++ b/repos/base/include/util/string.h @@ -130,7 +130,7 @@ namespace Genode { /** * Return length of null-terminated string in bytes */ - __attribute((optimize("no-tree-loop-distribute-patterns"))) + __attribute((optimize("no-tree-loop-distribute-patterns"))) inline size_t strlen(const char *s) { size_t res = 0; @@ -281,7 +281,7 @@ namespace Genode { * generation of a 'memset()' call in the 'while' loop * with gcc 10. */ - __attribute((optimize("no-tree-loop-distribute-patterns"))) + __attribute((optimize("no-tree-loop-distribute-patterns"))) inline void *memset(void *dst, uint8_t i, size_t size) { using word_t = unsigned long;