Paul Eggert wrote:
> It's not just Stroustrup saying this: it's deeply embedded in several 
> programming languages, e.g., the "_" anonymous identifier in ML, Prolog, 
> Go, and Rust.

... and this use of the '_' identifier makes Prolog programs unmaintainable.

> > Maybe we should have a way to declare that a function is meant to be an
> > implementation of a function type / API ?
> 
> There is a way to do that in C. In the .h file you do something like this:
> 
>    typedef int desired_API(char *);
> 
> and in client code you do this:
> 
>    desired_API f;
>    int
>    f (char *p)
>    {
>      ...
>    }

Interesting; thanks for mentioning it.

> I suppose that if GCC had a compiler switch saying "warn about 
> unused arguments only if the function has not already been declared that 
> way", that would remove some of the need for the UNNAMED gingerbread. 
> Not sure how well that'd go over with the GCC folks, though.

Will you report it in the GCC bug tracker, or should I do that?

Bruno




Reply via email to