[foreign-memaccess+abi] RFR: 8312059: Clarify the documention for variadic functions

Jorn Vernee jvernee at openjdk.org
Fri Jul 14 16:55:34 UTC 2023


This patch attempts to refine the javadoc for variadic functions further. Particularly, it tries to make it clearer that the layouts the native linker rejects are derived from the C specification. Instead of trying to say which layouts are reject, we say which C types are rejected, and then give a hint about how to map those C types into layouts, using `canonicalLayouts()`, which would tell a client which layouts are rejected.

Additionally, this patch removes the mentions of prototype-less functions, which are not considered variadic functions in C. It is also not clear whether arguments passed to such a function should be treated as variadic or not in the ABI (see linked issue). Finally the latest C standard, C23, prototype-less functions no longer exist, and a declaration of the form `void foo()` instead means the same as `void foo(void)`. For these reason, passing arguments to prototype-less functions will also not be supported (officially) by the linker. I wasn't sure about whether to add a specific note about that. I figured that just not saying they are supported, combined with the state of the latest C standard, would make this obvious enough (?).

-------------

Commit messages:
 - minor phrasing fix
 - re-add spurious brace removed
 - clarify variadic function docs in Linker

Changes: https://git.openjdk.org/panama-foreign/pull/846/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=846&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8312059
  Stats: 21 lines in 1 file changed: 3 ins; 5 del; 13 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/846.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign.git pull/846/head:pull/846

PR: https://git.openjdk.org/panama-foreign/pull/846


More information about the panama-dev mailing list