rktest icon indicating copy to clipboard operation
rktest copied to clipboard

Detect support for nextafterf in RKTest

Open ihilt opened this issue 1 year ago • 3 comments

As described in the nextafterf(3) man page for glibc, we check for the POSIX version and then provide our own definition of nextafterf if glibc does not.

ihilt avatar Apr 24 '25 15:04 ihilt

Is this something you would be interested in adding? There are some platforms which don't provide this function and it appears that checking for this POSIX version detects support correctly on Ubuntu 20.04 and in my particular use case. The nextafterf definition was pulled from musl-libc and it appears the project is MIT licensed.

ihilt avatar Apr 24 '25 17:04 ihilt

I guess this would be a good addition, my only thought is how to best integrate this while keeping rktest.h a single-header library

Warwolt avatar May 04 '25 00:05 Warwolt

Also, isn't nextafterf guaranteed to exist for C99? This is meant to be a C99 library. Maybe I'm misreading the manpage https://linux.die.net/man/3/nextafterf

Can you merge main into this branch? I think external pull requests should be able to run the tests now

Warwolt avatar May 04 '25 01:05 Warwolt

I guess this would be a good addition, my only thought is how to best integrate this while keeping rktest.h a single-header library Also, isn't nextafterf guaranteed to exist for C99? This is meant to be a C99 library. Maybe I'm misreading the manpage https://linux.die.net/man/3/nextafterf

No, you're right. This change doesn't really align with RKTest's goals. I did this a while ago and now I can't remember why the library I'm using doesn't provide nextafterf. I'll close this for now.

ihilt avatar May 05 '25 13:05 ihilt