Review request: ~200 build warning fixes to kdebase

Rolf Eike Beer kde at opensource.sf-tec.de
Sat Jun 5 12:55:49 BST 2010


Xander Moore wrote:
> These are pretty basic fixes, but should get rid of annoying build warnings
> for kdebase.
> I  opened bug 240173 and attached the patch, but apparently that is not the
> best way to get things reviwed and checked in.
> 
> This is mostly:
> 1) Initializing variables in all  code paths
> 2) Checking return values of write() read() pipe()
> 3) Adding Q_UNUSED(param) for unused parameters
> 
> Thanks for reviewing and any tips.

If you want to get rid of the return value of a function (e.g. nice() in the 
first hunk) try

  (void) nice(...)

Just some general notes about that low level C functions:

Using int as the return code of strlen() will give compiler warnings on some 
platforms, e.g. Windows64. Use size_t there. Ok, that one is build only on 
Un*x, but anyway. The return code of write() is ssize_t, not int. The return 
value of write may be less than the given length without an error, you just 
have to send the rest of the buffer later.

At the end I don't think that this makes any difference here. But this whole 
pipe()/write()/whatever stuff should just be thrown away and a KProcess should 
be used here. But for that sort of porting it's a bit late, that is 4.6 stuff 
IMHO.

And the floppy ioslave. Hm. I don't think that makes any sense anymore.

You are silencing some compiler warnings here that remind everybody that some 
of this low level fiddling really needs a cleanup. I fear if you shut them up 
nobody will touch these things for the next years again.

Just my thoughts.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100605/73a2048f/attachment.sig>


More information about the kde-core-devel mailing list