Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode_aprs.c: Limit __compar_fn_t to Linux #370

Closed
wants to merge 1 commit into from
Closed

Conversation

gdt
Copy link

@gdt gdt commented Jan 4, 2022

POSIX does not define __compar_fn_t. Rather than using it, except on
a list of systems where it does not exist, invert the conditional so that
it is used when it is known to exist, and on other systems --
including unknown systems -- use a POSIX-compatible invocation.

Probably switching on linux isn't really right, and instead there
should be a feature test in cmake. Alternatively, since passing
tocall_cmp without a cast doesn't result in warning, because it is the
same type except static, it would be simpler to just drop the use of
__compar_fn_t entirely.

POSIX does not define __compar_fn_t.   Rather than using it, except on
a list systems where it does not exist, invert the conditional so that
it is used when it is known to exist, and on other systems --
including unknown systems -- use a POSIX-compatible invocation.

Probably switching on __linux__ isn't really right, and instead there
should be a feature test in cmake.  Alternatively, since passing
tocall_cmp without a cast doesn't result in warning, because it is the
same type except static, it would be simpler to just drop the use of
__compar_fn_t entirely.
@gdt
Copy link
Author

gdt commented Jan 4, 2022

Resolves #369

@wb2osz
Copy link
Owner

wb2osz commented May 24, 2022

Thanks helping to improve the product.
As you suggested, I simply took out the type cast.
I noticed two other files call qsort without the type case it should not cause issues.

@wb2osz wb2osz closed this May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants