[gnutls-dev] Starting Guile integration

Ludovic Courtès ludovic.courtes at laas.fr
Fri Jun 8 13:52:06 CEST 2007


Simon Josefsson <simon at josefsson.org> writes:

> I think that either there actually are some cases were this usage will
> cause problems (perhaps for '...' function prototypes?  Or perhaps the C
> standard regards something in this as undefined, possibly function
> pointers aren't type-compatible in general), or GCC should not have a
> warning mechanism for it.  I'm leaning towards that there actually may
> be some platform where this could cause problems, and that was what
> prompted GCC to add this warning flag.

No no no.  From ISO/IEC 9899:1999 (aka. C99), Section,
Paragraph 14:

  The empty list in a function declarator that is not part of a
  definition of that function specifies that no information about the
  number or types of the parameters is supplied.124)

In other words, if F is declared as "extern int f ();", then it may
rightfully be passed any number of arguments.

This mechanism is different from the ellipsis though (Paragraph 9): such
functions are not treated differently from functions with full
prototypes; therefore, the "regular" calling conventions are used when
invoking them rather than that of variadic functions.

That said, this feature is reminiscent from older revisions of the
standard and Footnote 124 reads:

  The use of function declarators with empty parentheses (not
  prototype-format parameter type declarators) is an obsolescent

Thus, in the longer term, Guile will probably have to avoid it.

Besides, most of the warnings made available by GCC do not relate to
anything mandated by the standard.


More information about the Gnutls-devel mailing list