From: Julian Seward Date: Thu, 23 Oct 2008 09:46:59 +0000 (+0000) Subject: gcc-4.4.0 (snapshot) started complaining about buf.sem_nsems being X-Git-Tag: svn/VALGRIND_3_4_0~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbdd00b6e0c18962c39d1f816dd321cc88c3955d;p=thirdparty%2Fvalgrind.git gcc-4.4.0 (snapshot) started complaining about buf.sem_nsems being uninitialised in get_sem_count(). This makes it quiet. I am not sure whether get_sem_count() was correct or not without it (probably was OK). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8697 --- diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index ba0eaa7d46..4ef98a078a 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1580,6 +1580,11 @@ UInt get_sem_count( Int semid ) union vki_semun arg; SysRes res; + /* Doesn't actually seem to be necessary, but gcc-4.4.0 20081017 + (experimental) otherwise complains that the use in the return + statement below is uninitialised. */ + buf.sem_nsems = 0; + arg.buf = &buf; # ifdef __NR_semctl @@ -1587,7 +1592,7 @@ UInt get_sem_count( Int semid ) # else res = VG_(do_syscall5)(__NR_ipc, 3 /* IPCOP_semctl */, semid, 0, VKI_IPC_STAT, (UWord)&arg); -# endif +# endif if (res.isError) return 0;