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

qsort callback should always use cdecl calling convention #80

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

GabeNI
Copy link
Contributor

@GabeNI GabeNI commented Feb 27, 2024

C runtime functions that accept function pointers expect them to use the cdecl calling convention. The qsort compare function needs to be explicitly marked cdecl to handle the case where the compiler default calling convention is not cdecl (e.g., i386 Visual Studio builds with the /Gz flag or x86 gcc/clang with the -mrtd option).

@cxong cxong merged commit a4a2db5 into cxong:master Feb 27, 2024
12 checks passed
@GabeNI GabeNI deleted the qsort-callback-cdecl branch February 27, 2024 21:55
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