aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-05-14 12:12:29 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-05-14 18:51:49 +0200
commita4a351924575879fd96bf470f6340157ed560186 (patch)
treeae84c6f1223e59d5e262854bff50ede62446dde7 /string
parent98b2dc7e208772e7088c63e3031f75c2b92548b4 (diff)
downloadglibc-a4a351924575879fd96bf470f6340157ed560186.zip
glibc-a4a351924575879fd96bf470f6340157ed560186.tar.gz
glibc-a4a351924575879fd96bf470f6340157ed560186.tar.bz2
string: Fix string/tst-memmove-overflow to compile with GCC 7
GCC 8 relaxed what kind of expressions can be used in initializers, and the previous use of static const variables relied on that. Switch to wide (non-int) enum constants instead, which is another GCC extension that is more widely implemented. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'string')
-rw-r--r--string/tst-memmove-overflow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string/tst-memmove-overflow.c b/string/tst-memmove-overflow.c
index 77d693d..ffbcd04 100644
--- a/string/tst-memmove-overflow.c
+++ b/string/tst-memmove-overflow.c
@@ -42,11 +42,11 @@ IMPL (memmove, 1)
/* Size of the part of the allocation which is not shared, at the
start and the end of the overall allocation. 4 MiB. */
-static const size_t unshared_size = 4U << 20;
+enum { unshared_size = (size_t) 4U << 20 };
/* The allocation is 2 GiB plus 8 MiB. This should work with all page
sizes that occur in practice. */
-static const size_t allocation_size = (2U << 30) + 2 * unshared_size;
+enum { allocation_size = ((size_t) 2U << 30) + 2 * unshared_size };
/* Compute the expected byte at the given index. This is used to
produce a non-repeating pattern. */