G_GNUC_CONST usage



I thought I would just bring this bug I submitted to your attention:
  http://bugzilla.gnome.org/show_bug.cgi?id=51952

The function gdk_atom_name, which returns a g_strdup'd string, is marked
as G_GNUC_CONST in the gdk header files, which will cause some problems
if gcc decides to actually optimise away a call to gdk_atom_name (it would
leak the second return value, and the first return may end up being freed
twice.

I haven't checked the other uses of G_GNUC_CONST, but it may be worth
checking all the uses of the flag in gtk.  Tracking down a bug caused by
invalid compiler optimisations may cause a lot of problems for people
porting to gtk 2.0.

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]