QA checking kdelibs

Michael Pyne mpyne at purinchu.net
Sat Mar 7 21:01:04 GMT 2009


Hi all,

I was going through gcc warning flags yesterday and decided that it might be 
better to see how we are doing on the flags we're already using.  So I grepped 
my last full kdesvn-build run on kdelibs for warnings regarding ignored return 
values.

I then eliminated results concerning write(2)/read(2) since they were mostly 
used for error-exit handlers, or for proper race handling in signal handlers.  
I also ignored results from flex/bison generated code for now.

I didn't see anything major but I think it would be good to remove the 
warnings and fix some of the missing checks.  Here's the list:

kdelibs/kdesu/kdesu_stub.c:346: warning: ignoring return value of ‘system’
! system call is from running kdeinit4 --suicide.  Should kdesu_stub fail 
here?

kdelibs/kdecore/io/ktempdir.cpp:129: warning: ignoring return value of ‘int 
chown(const char*, __uid_t, __gid_t)’
! this call is from applying umask() after creating temp dir.  Do we really 
need to do umask(), doesn't
  mkdir (used by mkdtemp) already do this?

kdelibs/kimgio/eps.cpp:225: warning: ignoring return value of ‘size_t 
fwrite(const void*, size_t, size_t, FILE*)’
! used to communicate to ghostscript process, by feeding it the postscript 
information.  This probably needs fixed
  in case the file is large enough to require more than one fwrite call or in 
case EINTR is returned.

kdelibs/kdeui/util/kcrash.cpp:229: warning: ignoring return value of ‘int 
system(const char*)’
! to be honest I think this depends on whether the emergency restart command 
is supposed to block or not,
  but either way it appears to be treated as a crash to me, even if the 
restart command succeeds, I'm not
  sure what the right answer is here.

kdelibs/kioslave/file/file.cpp:1143: warning: ignoring return value of ‘int 
system(const char*)’
* Error handling seems to be handled separately.

kdelibs/kioslave/file/file_unix.cpp:374: warning: ignoring return value of 
‘char* getcwd(char*, size_t)’
kdelibs/kioslave/file/file_unix.cpp:397: warning: ignoring return value of 
‘int chdir(const char*)’
! The chdir should only be attempted if getcwd() succeeded IMO.

kdelibs/kinit/kinit.cpp:529: warning: ignoring return value of ‘int 
chdir(const char*)’
kdelibs/kinit/kinit.cpp:532: warning: ignoring return value of ‘int 
chdir(const char*)’
! Should probably fail here if chdir() fails.

kdelibs/kinit/kinit.cpp:857: warning: ignoring return value of ‘int 
chdir(const char*)’
! Should be checked.

kdelibs/kinit/kinit.cpp:1780: warning: ignoring return value of ‘int 
pipe(int*)’
! Probably warrants a check.

kdelibs/kinit/klauncher_main.cpp:109: warning: ignoring return value of ‘int 
pipe(int*)’
! Probably warrants a check.

kdelibs/kde3support/kdecore/k3tempfile.cpp:147: warning: ignoring return value 
of ‘int fchown(int, __uid_t, __gid_t)’
! Same concern as KTempDir above.

kdelibs/kde3support/kdecore/k3process.cpp:151: warning: ignoring return value 
of ‘int chdir(const char*)’
! Should probably be handled.

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090307/c3303144/attachment.sig>


More information about the kde-core-devel mailing list