From 7ed3f4e859896fbb8d384a4f101e40df47eb0ef0 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sat, 20 Apr 2013 12:12:35 +0200 Subject: [PATCH] Remove non-standard initialisation of flexible array member This avoids GCC bug 28865. --- ChangeLog | 6 ++++++ nss/nss_files/files-init.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4b41c6ddca..9a54ec7b5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-23 Andreas Schwab + + * nss/nss_files/files-init.c (TF): Don't initialize flexible array + member. + (_nss_files_init): Set it here. + 2013-04-23 Heiko Carstens * sysdeps/unix/sysv/linux/s390/bits/statfs.h: Change types of diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c index 8aac3fb08c..a34c49a99f 100644 --- a/nss/nss_files/files-init.c +++ b/nss/nss_files/files-init.c @@ -18,6 +18,7 @@ #ifdef USE_NSCD +#include #include @@ -30,7 +31,7 @@ static union \ { \ .file = \ { \ - .fname = filename, ## __VA_ARGS__ \ + __VA_ARGS__ \ } \ } @@ -45,16 +46,22 @@ TF (netgr, "/etc/netgroup"); void _nss_files_init (void (*cb) (size_t, struct traced_file *)) { + strcpy (pwd_traced_file.file.fname, "/etc/passwd"); cb (pwddb, &pwd_traced_file.file); + strcpy (grp_traced_file.file.fname, "/etc/group"); cb (grpdb, &grp_traced_file.file); + strcpy (hst_traced_file.file.fname, "/etc/hosts"); cb (hstdb, &hst_traced_file.file); + strcpy (resolv_traced_file.file.fname, "/etc/resolv.conf"); cb (hstdb, &resolv_traced_file.file); + strcpy (serv_traced_file.file.fname, "/etc/services"); cb (servdb, &serv_traced_file.file); + strcpy (netgr_traced_file.file.fname, "/etc/netgroup"); cb (netgrdb, &netgr_traced_file.file); }