[gnutls-dev] Starting Guile integration
Simon Josefsson
simon at josefsson.org
Fri Jun 8 13:41:50 CEST 2007
ludovic.courtes at laas.fr (Ludovic Courtès) writes:
> Simon Josefsson <simon at josefsson.org> writes:
>
>> ludovic.courtes at laas.fr (Ludovic Courtès) writes:
>
>>> That's because Guile contains this declaration:
>>>
>>> SCM scm_c_define_subr (const char *name, long type, SCM (*fcn)());
>>>
>>> This function allows C code to bind C function FCN to the Scheme level
>>> under NAME. It makes perfect sense to have FCN declared this way,
>>> because FCN can have any number of arguments (its number of required,
>>> optional and "rest" arguments are specified as part of TYPE).
>>>
>>> I can't think of a better way to declare FCN. Requiring users to cast
>>> their functions to, e.g., `SCM (* fcn) (void)', is not an option. At
>>> any rate, should a fix be found for Guile, it won't be available until
>>> the next Guile release.
>>
>> I can't think of a better solution right now. Still, do the warnings
>> cause any real harm? I'd rather not drop -Wstrict-prototypes if the
>> advantage of doing so would be to just hide some warnings.
>
> No, the warnings don't cause any harm by themselves, but it's annoying
> to get warnings for things that are intentional and harmless.
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.
>> Did you try changing the order of -Wno-strict-prototypes to see if you
>> really can't negate the effect of the other parameter?
>
> No I didn't, but it wouldn't be convenient. Currently,
> `guile/src/Makefile.am' adds `-Wno-strict-prototypes' to the
> `libxxx_CFLAGS' but those are appended to `CFLAGS' rather than
> prepended.
>
> I'll try to see if I can hack around something else but I'm not very
> hopeful...
I noticed you found a way. Great!
/Simon
More information about the Gnutls-devel
mailing list