Skip to content

Commit 434d4af

Browse files
committed
Mark main() with a C ABI
The documentation says that main() should have a C ABI. Additionally, the #[entry] macro will create a main() function that has a C ABI. Marking main() as 'extern "Rust"' is inconsistent with its calling convention.
1 parent 1bbc1bc commit 434d4af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cortex-m-rt/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,12 +897,11 @@ pub unsafe extern "C" fn Reset() -> ! {
897897
static mut __edata: u32;
898898
static __sidata: u32;
899899

900-
}
901-
902-
extern "Rust" {
903900
// This symbol will be provided by the user via `#[entry]`
904901
fn main() -> !;
902+
}
905903

904+
extern "Rust" {
906905
// This symbol will be provided by the user via `#[pre_init]`
907906
fn __pre_init();
908907
}

0 commit comments

Comments
 (0)