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

Jorn Vernee jvernee at openjdk.org
Fri Jul 14 17:42:58 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 one additional commit 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>

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

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

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

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