]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
gcc-4.4.0 (snapshot) started complaining about buf.sem_nsems being
authorJulian Seward <jseward@acm.org>
Thu, 23 Oct 2008 09:46:59 +0000 (09:46 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 23 Oct 2008 09:46:59 +0000 (09:46 +0000)
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

coregrind/m_syswrap/syswrap-generic.c

index ba0eaa7d469445fab06901b9ba2817965c3dbd44..4ef98a078ac2532b8ff9d9a18525dc96fcd1d09b 100644 (file)
@@ -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;