on VaList (request for feedback)
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Nov 18 17:35:53 UTC 2022
Thanks for the feedback Ioannis,
I was kind of expecting something similar (e.g. opaque usages).
Maurizio
On 18/11/2022 17:25, Ioannis Tsakpinis wrote:
> 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://urldefense.com/v3/__https://www.webhotelier.net__;!!ACWV5N9M2RV99hQ!L8kw9LseMgG4IYpSX6lq7aCZxzCirqOhCIXO-dEr2cvKmGflGLgV2ma9Fmj_WHJ5ckOkjrGs61e3mQfp_kYAC6A$
>
> 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://urldefense.com/v3/__https://stackoverflow.com/questions/46084267/is-there-a-way-to-prevent-clang-from-treating-va-list-as-va-list-tag__;!!ACWV5N9M2RV99hQ!L8kw9LseMgG4IYpSX6lq7aCZxzCirqOhCIXO-dEr2cvKmGflGLgV2ma9Fmj_WHJ5ckOkjrGs61e3mQfpcrwGibI$
>>
More information about the panama-dev
mailing list