[gnutls-dev] Starting Guile integration

Simon Josefsson simon at josefsson.org
Fri Jun 8 15:55:39 CEST 2007


ludovic.courtes at laas.fr (Ludovic Courtès) writes:

> Hi,
>
> 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 6.7.5.3,
> 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.

Ah, I see.  Thanks for the pointer.

> 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
>   feature.
>
> Thus, in the longer term, Guile will probably have to avoid it.

Yup.

/Simon



More information about the Gnutls-dev mailing list