Skip to content

Commit 9448ed4

Browse files
committed
Obviate #[allow(improper_ctypes_definitions)]
Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`.
1 parent 9f3c96b commit 9448ed4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/sys/sgx/abi/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ pub mod usercalls;
1717
#[cfg(not(test))]
1818
global_asm!(include_str!("entry.S"));
1919

20+
#[repr(C)]
21+
struct EntryReturn(u64, u64);
22+
2023
#[cfg(not(test))]
2124
#[no_mangle]
2225
unsafe extern "C" fn tcs_init(secondary: bool) {
@@ -56,16 +59,15 @@ unsafe extern "C" fn tcs_init(secondary: bool) {
5659
// able to specify this
5760
#[cfg(not(test))]
5861
#[no_mangle]
59-
#[allow(improper_ctypes_definitions)]
60-
extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> (u64, u64) {
62+
extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> EntryReturn {
6163
// FIXME: how to support TLS in library mode?
6264
let tls = Box::new(tls::Tls::new());
6365
let _tls_guard = unsafe { tls.activate() };
6466

6567
if secondary {
6668
super::thread::Thread::entry();
6769

68-
(0, 0)
70+
EntryReturn(0, 0)
6971
} else {
7072
extern "C" {
7173
fn main(argc: isize, argv: *const *const u8) -> isize;

0 commit comments

Comments
 (0)