QA checking kdelibs

David Faure faure at kde.org
Mon Mar 9 13:26:27 GMT 2009


Commenting on those entries which touch code I maintain (kdeinit, klauncher, kio_file) :

On Saturday 07 March 2009, Michael Pyne wrote:
> kdelibs/kioslave/file/file.cpp:1143: warning: ignoring return value of ‘int 
> system(const char*)’
> * Error handling seems to be handled separately.

Yep, code seems fine to me.

> 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.

Fixed.

> 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.

No, if you write a desktop file with Exec=foo and Path=/doesnotexist,
we still want to execute `foo` even if the chdir() failed. Ignoring errors
here is perfectly fine and wanted (should I add (void) to silence the warning?)

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

Indeed! This could happen when $HOME doesn't exist. Then we would
create the kdeinit socket in some random place like '/' (if root)...

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

Fixed.

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

Fixed.

Thanks for the report!

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list