Find attached patchset which address some serious compiler warning fixes spotted by GCC4.1 (SLES10 SP2) and GCC4.3 (openSUSE Factory). ftest04.c calls close() with uninitialized file descriptor variable. Fix warning about _is_ unused variable (note the difference between "may" and "is" unused!). Only child opens the file descriptor, once forked.
ftest04.c: In function 'runtest':
ftest04.c:188: warning: 'fd' is used uninitialized in this function

Valgrind spot this issue as well:
==15263== Syscall param close(fd) contains uninitialised byte(s)
==15263==    at 0x4BD70A0: __close_nocancel (in /lib64/libc-2.4.so)
==15263==    by 0x401CD6: runtest (ftest04.c:188)
==15263==    by 0x401AD0: main (ftest04.c:111)
Signed-off-by: Daniel Gollub <dgollub@suse.de>.
1 file changed