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

Jorn Vernee jvernee at openjdk.org
Fri Jul 14 17:57:35 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 (?).

Jorn Vernee has updated the pull request incrementally with two additional commits since the last revision:

 - Update src/java.base/share/classes/java/lang/foreign/Linker.java
   
   Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
 - review comments

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

Changes:
  - all: https://git.openjdk.org/panama-foreign/pull/846/files
  - new: https://git.openjdk.org/panama-foreign/pull/846/files/f4ba6b44..760d9ac9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=panama-foreign&pr=846&range=02
 - incr: https://webrevs.openjdk.org/?repo=panama-foreign&pr=846&range=01-02

  Stats: 10 lines in 1 file changed: 0 ins; 1 del; 9 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