on VaList (request for feedback)

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Nov 16 15:10:17 UTC 2022


Hi,
the FFM API provides an abstraction (VaList) to create an manipulate C 
variable argument lists (va_list).

This abstraction adds some API surface, and a lot of implementation 
complexity. However, given that jextract doesn't support va_list (**), I 
wonder how much VaList is used in practice. I would not be surprised if, 
in fact, it was never used, except for our own JDK tests.

Has anybody tried to experiment with the VaList API in the past, or 
found use cases for it? Please provide feedback, based on your 
experience (usability, performance, anything :-) ). We need some 
compelling reason to justify its presence in the Java SE API, beyond the 
fact that "it might be useful someday". Also, please note that while 
adding VaList now would mean maintaining it forever, nothing would 
prevent us from removing it from the API, but add it back later, when we 
know more about actual use cases.

Thanks
Maurizio

(**) jextract doesn't support va_list because the clang API does not 
present va_list as a "special" type. The clang API, including the more 
powerful C++ API (see [1]) just return whatever platform definition is 
behind va_list, thus making any kind of special casing impossible.

[1] - 
https://stackoverflow.com/questions/46084267/is-there-a-way-to-prevent-clang-from-treating-va-list-as-va-list-tag



More information about the panama-dev mailing list