From 2043b4e374e93943a49dc0088b4533cf62eb869a Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 16 Mar 2024 15:12:26 +0300 Subject: [PATCH] Fix build errors for gcc 8 --- src/nfs_fsstat.cpp | 9 +++++++-- src/nfs_kv_write.cpp | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/nfs_fsstat.cpp b/src/nfs_fsstat.cpp index e881c451..b2864d64 100644 --- a/src/nfs_fsstat.cpp +++ b/src/nfs_fsstat.cpp @@ -59,11 +59,15 @@ int nfs3_fsinfo_proc(void *opaque, rpc_op_t *rop) else { // Fill info + bool_t x = FALSE; *reply = (FSINFO3res){ .status = NFS3_OK, .resok = (FSINFO3resok){ .obj_attributes = { - .attributes_follow = 0, + // Without at least one reference to a non-constant value (local variable or something else), + // with gcc 8 we get "internal compiler error: side-effects element in no-side-effects CONSTRUCTOR" here + // FIXME: get rid of this after raising compiler requirement + .attributes_follow = x, //.attributes = get_root_attributes(self), }, .rtmax = 128*1024*1024, @@ -100,6 +104,7 @@ int nfs3_pathconf_proc(void *opaque, rpc_op_t *rop) else { // Fill info + bool_t x = FALSE; *reply = (PATHCONF3res){ .status = NFS3_OK, .resok = (PATHCONF3resok){ @@ -107,7 +112,7 @@ int nfs3_pathconf_proc(void *opaque, rpc_op_t *rop) // Without at least one reference to a non-constant value (local variable or something else), // with gcc 8 we get "internal compiler error: side-effects element in no-side-effects CONSTRUCTOR" here // FIXME: get rid of this after raising compiler requirement - .attributes_follow = 0, + .attributes_follow = x, //.attributes = get_root_attributes(self), }, .linkmax = 0, diff --git a/src/nfs_kv_write.cpp b/src/nfs_kv_write.cpp index e69d1130..ea8329c7 100644 --- a/src/nfs_kv_write.cpp +++ b/src/nfs_kv_write.cpp @@ -466,7 +466,7 @@ static void nfs_do_align_write(nfs_kv_write_state *st, uint64_t ino, uint64_t of else good_size = 0; s = s > st->size ? st->size : s; - st->rmw[0] = { + st->rmw[0] = (nfs_rmw_t){ .parent = st->self->parent, .ino = ino, .offset = offset, @@ -495,7 +495,7 @@ static void nfs_do_align_write(nfs_kv_write_state *st, uint64_t ino, uint64_t of good_size -= s; else good_size = 0; - st->rmw[1] = { + st->rmw[1] = (nfs_rmw_t){ .parent = st->self->parent, .ino = ino, .offset = end - s,