lsb

can/should mkheader emit funcptrs separately?

Bug #1329518 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lsb
In Progress
Medium
Unassigned
Mandriva
In Progress
Medium

Bug Description

In current in-progress fixup of gtk3 import, there are a lot of ordering
problems. Here are some samples:

/opt/lsb/include/gtk-3.0/gtk/gtk.h:794:37: error: unknown type name
‘GtkWidget’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:848:46: error: unknown type name
‘GtkTreeSelection’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:849:11: error: unknown type name
‘GtkTreeModel’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:850:11: error: unknown type name
‘GtkTreePath’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:855:50: error: unknown type name
‘GtkTreeModel’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:856:8: error: unknown type name
‘GtkTreePath’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:857:8: error: unknown type name
‘GtkTreeIter’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:879:7: error: unknown type name
‘GtkCellRenderer’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:880:7: error: unknown type name
‘GtkTreeModel’
/opt/lsb/include/gtk-3.0/gtk/gtk.h:881:7: error: unknown type name
‘GtkTreeIter’

  794 typedef gint(*GtkKeySnoopFunc) (GtkWidget * grab_widget,
  795 GdkEventKey * event,
  796 gpointer func_data);

  826 typedef struct _GtkWidget GtkWidget;

  848 typedef gboolean(*GtkTreeSelectionFunc) (GtkTreeSelection *
selection,
  849 GtkTreeModel * model,
  850 GtkTreePath * path,
  851 gboolean
  852 path_currently_selected,
  853 gpointer data);
  854
  855 typedef void (*GtkTreeSelectionForeachFunc) (GtkTreeModel * model,
  856 GtkTreePath * path,
  857 GtkTreeIter * iter,
  858 gpointer data);

  878 typedef void (*GtkTreeCellDataFunc) (GtkTreeViewColumn * tree_column,
  879 GtkCellRenderer * cell,
  880 GtkTreeModel * tree_model,
  881 GtkTreeIter * iter,
  882 gpointer data);

 1335 typedef struct _GtkCellRenderer GtkCellRenderer;

 2221 typedef struct _GtkTreeSelection GtkTreeSelection;

 2289 typedef struct _GtkTreeIter GtkTreeIter;

 2291 typedef struct _GtkTreePath GtkTreePath;

 2295 typedef struct _GtkTreeModel GtkTreeModel;

So this problem has nothing to do with structure /contents/ being
defined or not, just a use-before-define problem for typedefs.
Function prototypes are already emitted at the end of the header by
mkheader, so the problem appears to be entirely the definition of
function-pointer types. mkheader already knows these are complex,
it includes this comment:

# We can have long chains of inheritance with FuncPtr base (e.g. typedef
# to pointer to FuncPtr) such types cannot be processed in a usual way

Maybe there should be another step as well, to save these up and emit them
at the end so they follow the type definitions? Or perhaps there's some
more ordering decisions that can be made to sort this out.

I believe this could also be solved by HeaderGroups, simply assigning
all the function-pointer types to a header-group that comes after the
default one (in both the 2.0 and 3.0 gtk imports, the main headers,
gtk.h and gdk.h, are not split into headergroups at all at the moment).
But it would be nice if we didn't have to do that and mkheader could
somehow take care of it...

Changed in mandriva:
importance: Unknown → Medium
status: Unknown → In Progress
Jeff Johnson (n3npq)
tags: added: database infra rpm
Jeff Johnson (n3npq)
tags: added: gtk3 zclose
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.