Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with under-defined functions #55

Open
edsko opened this issue Aug 2, 2024 · 0 comments
Open

Deal with under-defined functions #55

edsko opened this issue Aug 2, 2024 · 0 comments

Comments

@edsko
Copy link
Collaborator

edsko commented Aug 2, 2024

The C specification allows to underspecify function signatures in two ways:

  • The parameter list can be entirely omitted:
    void foo();
    Note that this is not the same as
    void foo(void);
    which declares a function with no argument (the former declares a function with an unspecified number of arguments).
  • (Prior to C99) the number of arguments can be specified, without their types (using a separate "parameter list").

My understanding is that in both cases, function calls are subject to "default argument promotions"; see section 6.5.2.2, "Function calls" of the spec, or the section 24.3, "Argument Promotions" of the gcc manual.

The Haskell report talks about promotion in the FFI chapter.

@edsko edsko added this to the 4: Additional features milestone Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant