[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KDE3.4RC1: Incompatibility
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2005-03-14 20:45:22
Message-ID: 200503142145.22925.wheeler () kde ! org
[Download RAW message or body]

On Monday 14 March 2005 17:07, Martin Ellis wrote:
> On Sunday 13 Mar 2005 20:54, Scott Wheeler wrote:
> > Huh?  This is kind of a dumb idea, actually.  What will you gain by
> > replacing a well maintained C library with a Qt-based
> > implementation of its API?
>
> Some sanity maybe?
>
> Quoting myself on a different thread on KOffice-devel:
>
>   The glib API provides no checking of indices.
>
>   Contrast that to something like this from the Qt API
>     http://doc.trolltech.com/3.3/qstring.html#at,
>   where using out of bounds indices has a defined behaviour
>   (defined in the sense that it's not 'buffer overflow').

But you won't get around that with a C API.  Without operator overloading you 
can't fix:

GString *s = g_string_new("foo");
gchar c = s[10];

Even if you reimplement the API in Qt, you'd still have just overrun some 
buffer.  Where glib offers such things semantically (i.e. GList), the bounds 
are also checked.

-Scott

-- 
The three chief virtues of a programmer are: laziness, impatience and hubris.
--Larry Wall

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic