Suspicious code in kdelibs/kdebase revision 864329

Olivier Goffart ogoffart at kde.org
Thu Sep 25 08:13:13 BST 2008


Le jeudi 25 septembre 2008, Jason Stubbs a écrit :
> On Thu, Sep 25, 2008 at 8:00 AM, Aaron J. Seigo <aseigo at kde.org> wrote:
> > > - kdelibs/kdeui/widgets/ktoolbar.cpp:1056
> > >
> > > This loop is executed at most once. Not forever.
> >
> > false positive; not the most obvious bit of code, perhaps, but it's using
> > the
> > forever as a way to utilize break; statements as prettier gotos
>
> Personal preference, I guess, but I generally use do { } while (false); for
> these cases to be explicit that it is not a real loop.

Why not simply goto ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080925/59fc4ed2/attachment.sig>


More information about the kde-core-devel mailing list