We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.init_array.N
It would be nice if user could override execution order without changing code location.
The following code will panic because DATA is not initialized yet
DATA
#[ctor] static ACTUAL_DATA: u8 = *DATA; #[ctor] static DATA: u8 = 1; fn main() { println!("{}", *ACTUAL_DATA); }
fatal runtime error: failed to initiate panic, error 5 IOT instruction (core dumped)
If we swap two statics, it works normally.
My suggestion is to have ordering argument, so we can write
ordering
#[ctor(ordering = 2)] static ACTUAL_DATA: u8 = *DATA; #[ctor(ordering = 1)] static DATA: u8 = 1;
And as a result generate something like this:
#[link_section = ".init_array.1"]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be nice if user could override execution order without changing code location.
The following code will panic because
DATA
is not initialized yetIf we swap two statics, it works normally.
My suggestion is to have
ordering
argument, so we can writeAnd as a result generate something like this:
#[link_section = ".init_array.1"]
The text was updated successfully, but these errors were encountered: