[Geany-Devel] Memory leaks in Geany

Chow Loong Jin hyperair at xxxxx
Wed Sep 25 02:14:06 UTC 2013


On Wed, Sep 25, 2013 at 03:37:11AM +0200, Colomban Wendling wrote:
> Le 25/09/2013 03:23, Chow Loong Jin a écrit :
> > On Wed, Sep 25, 2013 at 12:27:14AM +0200, Colomban Wendling wrote:
> >> [...]
> >>> Other suggestions:
> >>> - enable -Wall -Wextra -Werror in compiler
> >>
> >> Yes, kinda advertized in HACKING -- but -Werror is harder to use because
> >> you need to check your flags VERY carefully not to produce any false
> >> positive.  E.g. -Wwrite-strings have a few false positive due to
> >> imperfect API.  But yeah, it's nice to stop on possible errors.  FTR, we
> > 
> > s/imperfect/broken/
> > 
> > It's not acceptable to modify const strings. Ever.
> 
> It's rather the other way around, API that expects string literals but
> also non-constant pointers.  I'm watching you GtkTargetEntry.

An API that takes a const char* can also take non-const char*'s. So if the
function doesn't need to modify the string, it should just take a const char *
instead.

-- 
Kind regards,
Loong Jin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.geany.org/pipermail/devel/attachments/20130925/f127c576/attachment-0001.pgp>


More information about the Devel mailing list