Re: Review of gnio, round 2



On 05/07/2009 03:28 PM, Alexander Larsson wrote:
The prototypes for e.g. g_initable_new() is purposely the same as
g_object_new(). However, if we change it from:
  gpointer g_initable_new (GType          object_type,
			  GCancellable  *cancellable,
			  GError       **error,
			  const gchar   *first_property_name,
			  ...);
to:
  gpointer g_initable_new (GType          object_type,
			  GCancellable  *cancellable,
			  GError       **error,
			  ...);
we could add a G_GNUC_NULL_TERMINATED marker so that missing NULLs would
cause a warning. This isn't possible with the g_object_new() prototype,
because then g_object_type (G_TYPE_FOO, NULL) would cause a warning.
However, this would mean the prototypes would differ from the more
commonly used g_object_new(). Does this matter?

How about filing a bug against gcc to add support for the idiom used in g_object_new? Namely, that the first item in the varargs arguments is the one spelled out and hence can contain the sentinel. We can decide how to push that in glib later.

behdad


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