summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2012-11-21 14:07:05 +0530
committerAnand Avati <avati@redhat.com>2013-01-21 22:17:36 -0800
commit777d395feaa082a69e32d985bbc1cca3d3dad077 (patch)
tree0aa6c1a1390320bd8ac674e14ca1c3da58c39927
parent6e18e3bd81f8dac9467aaa6cbe84499b891ca367 (diff)
core: fixes for gcc's '-pedantic' flag build
* warnings on 'void *' arguments * warnings on empty initializations * warnings on empty array (array[0]) Change-Id: Iae440f54cbd59580eb69f3ecaed5a9926c0edf95 BUG: 875913 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/4219 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--api/src/glfs-master.c9
-rw-r--r--contrib/fuse-include/fuse_kernel.h2
-rw-r--r--contrib/libgen/basename_r.c4
-rw-r--r--contrib/libgen/dirname_r.c2
-rw-r--r--libglusterfs/src/gf-dirent.h2
-rw-r--r--libglusterfs/src/latency.c82
-rw-r--r--libglusterfs/src/syncop.c2
-rw-r--r--libglusterfs/src/xlator.c10
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c2
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c6
-rw-r--r--xlators/cluster/dht/src/dht-common.h2
-rw-r--r--xlators/debug/error-gen/src/error-gen.c3
-rw-r--r--xlators/encryption/rot-13/src/rot-13.c3
-rw-r--r--xlators/features/index/src/index.c3
-rw-r--r--xlators/features/mac-compat/src/mac-compat.c3
-rw-r--r--xlators/features/quiesce/src/quiesce.c6
-rw-r--r--xlators/features/read-only/src/worm.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c6
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c8
-rw-r--r--xlators/nfs/server/src/nfs-fops.h2
-rw-r--r--xlators/nfs/server/src/nfs-inodes.c2
-rw-r--r--xlators/nfs/server/src/nfs.c2
-rw-r--r--xlators/performance/io-threads/src/io-threads.c3
-rw-r--r--xlators/performance/md-cache/src/md-cache.c6
-rw-r--r--xlators/protocol/server/src/server.c6
-rw-r--r--xlators/system/posix-acl/src/posix-acl-xattr.h2
-rw-r--r--xlators/system/posix-acl/src/posix-acl.h2
27 files changed, 85 insertions, 98 deletions
diff --git a/api/src/glfs-master.c b/api/src/glfs-master.c
index 0806c30..e6c46e3 100644
--- a/api/src/glfs-master.c
+++ b/api/src/glfs-master.c
@@ -101,13 +101,10 @@ fini (xlator_t *this)
}
-struct xlator_dumpops dumpops = {
-};
+struct xlator_dumpops dumpops;
-struct xlator_fops fops = {
-};
+struct xlator_fops fops;
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
diff --git a/contrib/fuse-include/fuse_kernel.h b/contrib/fuse-include/fuse_kernel.h
index 9ae25d6..e6fdcf8 100644
--- a/contrib/fuse-include/fuse_kernel.h
+++ b/contrib/fuse-include/fuse_kernel.h
@@ -556,7 +556,7 @@ struct fuse_dirent {
__u64 off;
__u32 namelen;
__u32 type;
- char name[0];
+ char name[];
};
#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
diff --git a/contrib/libgen/basename_r.c b/contrib/libgen/basename_r.c
index d63bce4..2c3a87a 100644
--- a/contrib/libgen/basename_r.c
+++ b/contrib/libgen/basename_r.c
@@ -1,10 +1,10 @@
-#ifdef THREAD_UNSAFE_BASENAME
/*
- * borrowed from glibc-2.12.1/string/basename.c
+ * borrowed from glibc-2.12.1/string/basename.c
* Modified to return "." for NULL or "", as required for SUSv2.
*/
#include <string.h>
#include <stdlib.h>
+#ifdef THREAD_UNSAFE_BASENAME
/* Return the name-within-directory of a file name.
Copyright (C) 1996,97,98,2002 Free Software Foundation, Inc.
diff --git a/contrib/libgen/dirname_r.c b/contrib/libgen/dirname_r.c
index 02981f5..131cbcf 100644
--- a/contrib/libgen/dirname_r.c
+++ b/contrib/libgen/dirname_r.c
@@ -1,4 +1,3 @@
-#ifdef THREAD_UNSAFE_DIRNAME
/*
* Borrowed from glibc-2.12.1/string/memrchr.c
* Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
@@ -7,6 +6,7 @@
*/
#include <string.h>
#include <stdlib.h>
+#ifdef THREAD_UNSAFE_DIRNAME
/* memrchr -- find the last occurrence of a byte in a memory block
Copyright (C) 1991, 93, 96, 97, 99, 2000 Free Software Foundation, Inc.
diff --git a/libglusterfs/src/gf-dirent.h b/libglusterfs/src/gf-dirent.h
index 26cb5a6..588d522 100644
--- a/libglusterfs/src/gf-dirent.h
+++ b/libglusterfs/src/gf-dirent.h
@@ -45,7 +45,7 @@ struct _gf_dirent_t {
struct iatt d_stat;
dict_t *dict;
inode_t *inode;
- char d_name[0];
+ char d_name[];
};
#define DT_ISDIR(mode) (mode == DT_DIR)
diff --git a/libglusterfs/src/latency.c b/libglusterfs/src/latency.c
index f143a8e..9fe76ef 100644
--- a/libglusterfs/src/latency.c
+++ b/libglusterfs/src/latency.c
@@ -26,87 +26,87 @@ gf_set_fop_from_fn_pointer (call_frame_t *frame, struct xlator_fops *fops, void
{
glusterfs_fop_t fop = -1;
- if (fops->stat == fn)
+ if (fops->stat == *(fop_stat_t *)fn)
fop = GF_FOP_STAT;
- else if (fops->readlink == fn)
+ else if (fops->readlink == *(fop_readlink_t *)fn)
fop = GF_FOP_READLINK;
- else if (fops->mknod == fn)
+ else if (fops->mknod == *(fop_mknod_t *)fn)
fop = GF_FOP_MKNOD;
- else if (fops->mkdir == fn)
+ else if (fops->mkdir == *(fop_mkdir_t *)fn)
fop = GF_FOP_MKDIR;
- else if (fops->unlink == fn)
+ else if (fops->unlink == *(fop_unlink_t *)fn)
fop = GF_FOP_UNLINK;
- else if (fops->rmdir == fn)
+ else if (fops->rmdir == *(fop_rmdir_t *)fn)
fop = GF_FOP_RMDIR;
- else if (fops->symlink == fn)
+ else if (fops->symlink == *(fop_symlink_t *)fn)
fop = GF_FOP_SYMLINK;
- else if (fops->rename == fn)
+ else if (fops->rename == *(fop_rename_t *)fn)
fop = GF_FOP_RENAME;
- else if (fops->link == fn)
+ else if (fops->link == *(fop_link_t *)fn)
fop = GF_FOP_LINK;
- else if (fops->truncate == fn)
+ else if (fops->truncate == *(fop_truncate_t *)fn)
fop = GF_FOP_TRUNCATE;
- else if (fops->open == fn)
+ else if (fops->open == *(fop_open_t *)fn)
fop = GF_FOP_OPEN;
- else if (fops->readv == fn)
+ else if (fops->readv == *(fop_readv_t *)fn)
fop = GF_FOP_READ;
- else if (fops->writev == fn)
+ else if (fops->writev == *(fop_writev_t *)fn)
fop = GF_FOP_WRITE;
- else if (fops->statfs == fn)
+ else if (fops->statfs == *(fop_statfs_t *)fn)
fop = GF_FOP_STATFS;
- else if (fops->flush == fn)
+ else if (fops->flush == *(fop_flush_t *)fn)
fop = GF_FOP_FLUSH;
- else if (fops->fsync == fn)
+ else if (fops->fsync == *(fop_fsync_t *)fn)
fop = GF_FOP_FSYNC;
- else if (fops->setxattr == fn)
+ else if (fops->setxattr == *(fop_setxattr_t *)fn)
fop = GF_FOP_SETXATTR;
- else if (fops->getxattr == fn)
+ else if (fops->getxattr == *(fop_getxattr_t *)fn)
fop = GF_FOP_GETXATTR;
- else if (fops->removexattr == fn)
+ else if (fops->removexattr == *(fop_removexattr_t *)fn)
fop = GF_FOP_REMOVEXATTR;
- else if (fops->opendir == fn)
+ else if (fops->opendir == *(fop_opendir_t *)fn)
fop = GF_FOP_OPENDIR;
- else if (fops->fsyncdir == fn)
+ else if (fops->fsyncdir == *(fop_fsyncdir_t *)fn)
fop = GF_FOP_FSYNCDIR;
- else if (fops->access == fn)
+ else if (fops->access == *(fop_access_t *)fn)
fop = GF_FOP_ACCESS;
- else if (fops->create == fn)
+ else if (fops->create == *(fop_create_t *)fn)
fop = GF_FOP_CREATE;
- else if (fops->ftruncate == fn)
+ else if (fops->ftruncate == *(fop_ftruncate_t *)fn)
fop = GF_FOP_FTRUNCATE;
- else if (fops->fstat == fn)
+ else if (fops->fstat == *(fop_fstat_t *)fn)
fop = GF_FOP_FSTAT;
- else if (fops->lk == fn)
+ else if (fops->lk == *(fop_lk_t *)fn)
fop = GF_FOP_LK;
- else if (fops->lookup == fn)
+ else if (fops->lookup == *(fop_lookup_t *)fn)
fop = GF_FOP_LOOKUP;
- else if (fops->readdir == fn)
+ else if (fops->readdir == *(fop_readdir_t *)fn)
fop = GF_FOP_READDIR;
- else if (fops->inodelk == fn)
+ else if (fops->inodelk == *(fop_inodelk_t *)fn)
fop = GF_FOP_INODELK;
- else if (fops->finodelk == fn)
+ else if (fops->finodelk == *(fop_finodelk_t *)fn)
fop = GF_FOP_FINODELK;
- else if (fops->entrylk == fn)
+ else if (fops->entrylk == *(fop_entrylk_t *)fn)
fop = GF_FOP_ENTRYLK;
- else if (fops->fentrylk == fn)
+ else if (fops->fentrylk == *(fop_fentrylk_t *)fn)
fop = GF_FOP_FENTRYLK;
- else if (fops->xattrop == fn)
+ else if (fops->xattrop == *(fop_xattrop_t *)fn)
fop = GF_FOP_XATTROP;
- else if (fops->fxattrop == fn)
+ else if (fops->fxattrop == *(fop_fxattrop_t *)fn)
fop = GF_FOP_FXATTROP;
- else if (fops->fgetxattr == fn)
+ else if (fops->fgetxattr == *(fop_fgetxattr_t *)fn)
fop = GF_FOP_FGETXATTR;
- else if (fops->fsetxattr == fn)
+ else if (fops->fsetxattr == *(fop_fsetxattr_t *)fn)
fop = GF_FOP_FSETXATTR;
- else if (fops->rchecksum == fn)
+ else if (fops->rchecksum == *(fop_rchecksum_t *)fn)
fop = GF_FOP_RCHECKSUM;
- else if (fops->setattr == fn)
+ else if (fops->setattr == *(fop_setattr_t *)fn)
fop = GF_FOP_SETATTR;
- else if (fops->fsetattr == fn)
+ else if (fops->fsetattr == *(fop_fsetattr_t *)fn)
fop = GF_FOP_FSETATTR;
- else if (fops->readdirp == fn)
+ else if (fops->readdirp == *(fop_readdirp_t *)fn)
fop = GF_FOP_READDIRP;
- else if (fops->getspec == fn)
+ else if (fops->getspec == *(fop_getspec_t *)fn)
fop = GF_FOP_GETSPEC;
else
fop = -1;
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 471ae1e..0c807ef 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -220,7 +220,7 @@ synctask_new (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
newtask->ctx.uc_stack.ss_sp = newtask->stack;
newtask->ctx.uc_stack.ss_size = env->stacksize;
- makecontext (&newtask->ctx, (void *) synctask_wrap, 2, newtask);
+ makecontext (&newtask->ctx, (void (*)(void)) synctask_wrap, 2, newtask);
newtask->state = SYNCTASK_INIT;
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index b42bc3b..22c81f8 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -218,19 +218,19 @@ xlator_dynload (xlator_t *xl)
goto out;
}
- if (!(xl->init = dlsym (handle, "init"))) {
+ if (!(*VOID(&xl->init) = dlsym (handle, "init"))) {
gf_log ("xlator", GF_LOG_WARNING, "dlsym(init) on %s",
dlerror ());
goto out;
}
- if (!(xl->fini = dlsym (handle, "fini"))) {
+ if (!(*VOID(&(xl->fini)) = dlsym (handle, "fini"))) {
gf_log ("xlator", GF_LOG_WARNING, "dlsym(fini) on %s",
dlerror ());
goto out;
}
- if (!(xl->notify = dlsym (handle, "notify"))) {
+ if (!(*VOID(&(xl->notify)) = dlsym (handle, "notify"))) {
gf_log ("xlator", GF_LOG_TRACE,
"dlsym(notify) on %s -- neglecting", dlerror ());
}
@@ -240,13 +240,13 @@ xlator_dynload (xlator_t *xl)
"dlsym(dumpops) on %s -- neglecting", dlerror ());
}
- if (!(xl->mem_acct_init = dlsym (handle, "mem_acct_init"))) {
+ if (!(*VOID(&(xl->mem_acct_init)) = dlsym (handle, "mem_acct_init"))) {
gf_log (xl->name, GF_LOG_TRACE,
"dlsym(mem_acct_init) on %s -- neglecting",
dlerror ());
}
- if (!(xl->reconfigure = dlsym (handle, "reconfigure"))) {
+ if (!(*VOID(&(xl->reconfigure)) = dlsym (handle, "reconfigure"))) {
gf_log ("xlator", GF_LOG_TRACE,
"dlsym(reconfigure) on %s -- neglecting",
dlerror());
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index a2f7872..b3f88d2 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -444,7 +444,7 @@ rpc_clnt_reconnect (void *trans_ptr)
int
rpc_clnt_fill_request_info (struct rpc_clnt *clnt, rpc_request_info_t *info)
{
- struct saved_frame saved_frame = {{}, 0};
+ struct saved_frame saved_frame;
int ret = -1;
pthread_mutex_lock (&clnt->conn.lock);
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index ef80e33..695261a 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -266,21 +266,21 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name)
goto fail;
}
- trans->init = dlsym (handle, "init");
+ *VOID(&(trans->init)) = dlsym (handle, "init");
if (trans->init == NULL) {
gf_log ("rpc-transport", GF_LOG_ERROR,
"dlsym (gf_rpc_transport_init) on %s", dlerror ());
goto fail;
}
- trans->fini = dlsym (handle, "fini");
+ *VOID(&(trans->fini)) = dlsym (handle, "fini");
if (trans->fini == NULL) {
gf_log ("rpc-transport", GF_LOG_ERROR,
"dlsym (gf_rpc_transport_fini) on %s", dlerror ());
goto fail;
}
- trans->reconfigure = dlsym (handle, "reconfigure");
+ *VOID(&(trans->reconfigure)) = dlsym (handle, "reconfigure");
if (trans->fini == NULL) {
gf_log ("rpc-transport", GF_LOG_DEBUG,
"dlsym (gf_rpc_transport_reconfigure) on %s", dlerror());
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 83ec345..764b37a 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -53,7 +53,7 @@ struct dht_layout {
uint32_t start;
uint32_t stop;
xlator_t *xlator;
- } list[0];
+ } list[];
};
typedef struct dht_layout dht_layout_t;
diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c
index 2194a90..6bdb041 100644
--- a/xlators/debug/error-gen/src/error-gen.c
+++ b/xlators/debug/error-gen/src/error-gen.c
@@ -2131,8 +2131,7 @@ struct xlator_dumpops dumpops = {
.priv = error_gen_priv_dump,
};
-struct xlator_fops cbks = {
-};
+struct xlator_fops cbks;
struct xlator_fops fops = {
.lookup = error_gen_lookup,
diff --git a/xlators/encryption/rot-13/src/rot-13.c b/xlators/encryption/rot-13/src/rot-13.c
index c475e5c..b9ac29a 100644
--- a/xlators/encryption/rot-13/src/rot-13.c
+++ b/xlators/encryption/rot-13/src/rot-13.c
@@ -186,8 +186,7 @@ struct xlator_fops fops = {
.writev = rot13_writev
};
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct volume_options options[] = {
{ .key = {"encrypt-write"},
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index d061c41..3245076 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -1183,8 +1183,7 @@ struct xlator_fops fops = {
.unlink = index_unlink
};
-struct xlator_dumpops dumpops = {
-};
+struct xlator_dumpops dumpops;
struct xlator_cbks cbks = {
.forget = index_forget,
diff --git a/xlators/features/mac-compat/src/mac-compat.c b/xlators/features/mac-compat/src/mac-compat.c
index b50afe9..7cb550a 100644
--- a/xlators/features/mac-compat/src/mac-compat.c
+++ b/xlators/features/mac-compat/src/mac-compat.c
@@ -230,8 +230,7 @@ struct xlator_fops fops = {
.fsetxattr = maccomp_fsetxattr,
};
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct volume_options options[] = {
{ .key = {NULL} },
diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c
index 527a48b..73eb919 100644
--- a/xlators/features/quiesce/src/quiesce.c
+++ b/xlators/features/quiesce/src/quiesce.c
@@ -2599,12 +2599,10 @@ struct xlator_fops fops = {
};
-struct xlator_dumpops dumpops = {
-};
+struct xlator_dumpops dumpops;
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct volume_options options[] = {
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c
index 34e7d66..16c3eb3 100644
--- a/xlators/features/read-only/src/worm.c
+++ b/xlators/features/read-only/src/worm.c
@@ -81,8 +81,7 @@ struct xlator_fops fops = {
.lk = ro_lk,
};
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct volume_options options[] = {
{ .key = {NULL} },
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 014f1d5..644c837 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -1211,11 +1211,9 @@ notify (xlator_t *this, int32_t event, void *data, ...)
}
-struct xlator_fops fops = {
-};
+struct xlator_fops fops;
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct xlator_dumpops dumpops = {
.priv = glusterd_priv,
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 214923d..875abbe 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -4706,8 +4706,7 @@ static fuse_handler_t *fuse_std_ops[FUSE_OP_HIGH] = {
};
-static fuse_handler_t *fuse_dump_ops[FUSE_OP_HIGH] = {
-};
+static fuse_handler_t *fuse_dump_ops[FUSE_OP_HIGH];
static void
@@ -4735,7 +4734,7 @@ fuse_dumper (xlator_t *this, fuse_in_header_t *finh, void *msg)
"failed to dump fuse message (R): %s",
strerror (errno));
- return priv->fuse_ops0[finh->opcode] (this, finh, msg);
+ priv->fuse_ops0[finh->opcode] (this, finh, msg);
}
@@ -5065,8 +5064,7 @@ fini (xlator_t *this_xl)
kill (getpid (), SIGTERM);
}
-struct xlator_fops fops = {
-};
+struct xlator_fops fops;
struct xlator_cbks cbks = {
.invalidate = fuse_invalidate,
diff --git a/xlators/nfs/server/src/nfs-fops.h b/xlators/nfs/server/src/nfs-fops.h
index 3ada863..d846e14 100644
--- a/xlators/nfs/server/src/nfs-fops.h
+++ b/xlators/nfs/server/src/nfs-fops.h
@@ -120,7 +120,7 @@ nfs_fop_local_wipe (xlator_t *xl, struct nfs_fop_local *l);
nflocal = nfs_fop_local_init (nf); \
if (nflocal) { \
nflocal->proglocal = plocal; \
- nflocal->progcbk = pcbk; \
+ nflocal->progcbk = *VOID(&pcbk); \
nflocal->nfsx = nf; \
if (fram) \
((call_frame_t *)fram)->local = nflocal;\
diff --git a/xlators/nfs/server/src/nfs-inodes.c b/xlators/nfs/server/src/nfs-inodes.c
index c9bf372..a68f8b2 100644
--- a/xlators/nfs/server/src/nfs-inodes.c
+++ b/xlators/nfs/server/src/nfs-inodes.c
@@ -36,7 +36,7 @@
do { \
nflocal = fram->local; \
fram->local = nflocal->proglocal; \
- pcbk = nflocal->progcbk; \
+ *VOID(&pcbk) = nflocal->progcbk; \
nfs_fop_local_wipe (nflocal->nfsx, nflocal); \
} while (0) \
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 8e40698..466393e 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -1004,7 +1004,7 @@ struct xlator_cbks cbks = {
.forget = nfs_forget,
};
-struct xlator_fops fops = { };
+struct xlator_fops fops;
struct xlator_dumpops dumpops = {
.priv = nfs_priv,
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index dbf1929..ccbd411 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2738,8 +2738,7 @@ struct xlator_fops fops = {
.rchecksum = iot_rchecksum,
};
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct volume_options options[] = {
{ .key = {"thread-count"},
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 237acab..9ccd655 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -65,7 +65,11 @@ static struct mdc_key {
.load = 0,
.check = 1,
},
- {},
+ {
+ .name = NULL,
+ .load = 0,
+ .check = 0,
+ }
};
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index d2bc487..cdf421d 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -1220,11 +1220,9 @@ notify (xlator_t *this, int32_t event, void *data, ...)
}
-struct xlator_fops fops = {
-};
+struct xlator_fops fops;
-struct xlator_cbks cbks = {
-};
+struct xlator_cbks cbks;
struct xlator_dumpops dumpops = {
.priv = server_priv,
diff --git a/xlators/system/posix-acl/src/posix-acl-xattr.h b/xlators/system/posix-acl/src/posix-acl-xattr.h
index 9035d87..c4e90f5 100644
--- a/xlators/system/posix-acl/src/posix-acl-xattr.h
+++ b/xlators/system/posix-acl/src/posix-acl-xattr.h
@@ -27,7 +27,7 @@ struct posix_acl_xattr_entry {
struct posix_acl_xattr_header {
uint32_t version;
- struct posix_acl_xattr_entry entries[0];
+ struct posix_acl_xattr_entry entries[];
};
struct posix_acl *posix_acl_from_xattr (xlator_t *this, const char *buf, int size);
diff --git a/xlators/system/posix-acl/src/posix-acl.h b/xlators/system/posix-acl/src/posix-acl.h
index 0c2b647..6ac2c6a 100644
--- a/xlators/system/posix-acl/src/posix-acl.h
+++ b/xlators/system/posix-acl/src/posix-acl.h
@@ -43,7 +43,7 @@ struct posix_ace {
struct posix_acl {
int refcnt;
int count;
- struct posix_ace entries[0];
+ struct posix_ace entries[];
};