on VaList (request for feedback)
Ioannis Tsakpinis
iotsakp at gmail.com
Fri Nov 18 17:25:15 UTC 2022
Hey Maurizio,
As far as LWJGL is concerned, we won't miss anything without va_list
support. Across all the APIs we have bindings for, there are only 2
legitimate use cases and va_list is a callback function parameter in
both. The callbacks are debug/log style functions, like:
void (*foo) (
// other parameters here
const char *format,
va_list args
)
va_list is exposed as an opaque handle in this case, that the user can
pass to vsnprintf to get the formatted text. The same could be done in
Panama without special support.
+1 for dropping the VaList API.
- Ioannis
Ioannis Tsakpinis
Backend Engineer | WebHotelier
https://www.webhotelier.net
email: iotsakp at gmail.com
skype: iotsakp
phone: +30 6949 191 475
On Wed, 16 Nov 2022 at 17:11, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
>
> 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