Skip to content

make bz_internal_error an extern fn#135

Merged
folkertdev merged 1 commit intomasterfrom
extern-bz_internal_error
Feb 28, 2025
Merged

make bz_internal_error an extern fn#135
folkertdev merged 1 commit intomasterfrom
extern-bz_internal_error

Conversation

@folkertdev
Copy link
Member

@folkertdev folkertdev commented Feb 28, 2025

We're treating this as a soundness fix. While currently using the rust ABI happens to work, it might (in theory) break at any point in the future.

Technically this is breaking semver compatibility, but we believe this will not be observed by any of our users.Bumping the MSRV of a -sys crate causes a lot of duplicate dependencies and ecosystem churn, so it's something that we'd rather avoid.

We're treating this as a soundness fix.
Technically this is breaking MSRV, but we believe this will not be observed by any of our users.
Comment on lines 71 to 74
#[no_mangle]
pub fn bz_internal_error(errcode: c_int) {
pub extern "C" fn bz_internal_error(errcode: c_int) {
panic!("bz internal error: {}", errcode);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to use extern "system" on windows given our MSRV?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extern "system" is the same as extern "C" except on 32bit Windows where it is the same as extern "stdcall". bzip2 uses extern "stdcall" for all BZ2_* methods on 32bit Windows, but uses the regular C ABI for bz_internal_error.

@folkertdev folkertdev requested a review from bjorn3 February 28, 2025 11:30
@folkertdev folkertdev merged commit 6a5073a into master Feb 28, 2025
24 checks passed
@bjorn3 bjorn3 deleted the extern-bz_internal_error branch February 28, 2025 13:27
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