Re: Unidentified subject!




Kaz Kylheku <kaz@ashi.footprints.net> writes:

> On Sun, 16 Jan 2000, Jeroen Ruigrok/Asmodai wrote:
> 
> > >
> > >typedef void    (*GtkItemFactoryCallback)  ();
> > >
> > >to
> > >
> > >typedef void    (*GtkItemFactoryCallback)  (void);
> > 
> > I mistook them for empty braces.  But I understand these should be
> > variable argument cases.  Am I correct in this assumption?
> 
> No. The way to declare a variadic function in C and C++ is to use ellipses.  An
> empty parameter list in C++ declares a function that takes no parameters, like
> the (void) list in ANSI C.  An empty parameter list in C declares a function
> which takes a fixed number of arguments, but does not specify that number, or
> their types.

To repeat once more - () in ANSI C means unspecified number of
parameters, and I doubt it will ever mean no arguments. (...) is
illegal in ANSI C.

Currently, we do use () to mean uns`apecified numbers of arguments,
However, last time I looked at the draft C9X spec, it mentioned that
this usage was deprecated (I'm not sure if it said so formally, but
the implication was clear), so I was opposed (but not forcefully enough)
to ever using this usage in GTK+, and I would like to get rid of it
in GTK+-1.4. For ItemFactory, this just means 

  typedef GtkItemFactoryCallback1 GtkItemFactoryCallback;

Since the other form, GtkItemFactoryCallback2 is only there for
menufactory compatibility, and was thus deprecated in GTK+-1.2.

Regards,
                                        Owen



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