Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit cd2ee10

Browse files
committed
Suppress warnings about use of ErlangResult in C definitions
1 parent 996120c commit cd2ee10

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

runtimes/tiny/src/erlang/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ use std::io::Write;
33
use liblumen_rt::function::ErlangResult;
44
use liblumen_rt::term::*;
55

6+
#[allow(improper_ctypes_definitions)]
67
#[export_name = "erlang:display/1"]
78
pub extern "C-unwind" fn display(term: OpaqueTerm) -> ErlangResult {
89
let term: Term = term.into();
910
println!("{}", &term);
1011
Ok(true.into())
1112
}
1213

14+
#[allow(improper_ctypes_definitions)]
1315
#[export_name = "erlang:puts/1"]
1416
pub extern "C-unwind" fn puts(printable: OpaqueTerm) -> ErlangResult {
1517
let printable: Term = printable.into();
@@ -23,11 +25,13 @@ pub extern "C-unwind" fn puts(printable: OpaqueTerm) -> ErlangResult {
2325
Ok(true.into())
2426
}
2527

28+
#[allow(improper_ctypes_definitions)]
2629
#[export_name = "erlang:is_atom/1"]
2730
pub extern "C-unwind" fn is_atom(term: OpaqueTerm) -> ErlangResult {
2831
Ok(term.is_atom().into())
2932
}
3033

34+
#[allow(improper_ctypes_definitions)]
3135
#[export_name = "erlang:=:=/2"]
3236
pub extern "C-unwind" fn exact_eq(lhs: OpaqueTerm, rhs: OpaqueTerm) -> ErlangResult {
3337
let lhs: Term = lhs.into();

runtimes/tiny/src/init/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use crate::env;
55
use crate::scheduler;
66

77
extern "C-unwind" {
8+
#[allow(improper_ctypes)]
9+
#[allow(improper_ctypes_definitions)]
810
#[link_name = "init:boot/1"]
911
fn boot(argv: OpaqueTerm) -> ErlangResult;
1012
}
@@ -16,6 +18,7 @@ extern "C-unwind" {
1618
/// a different module, `Module:boot/1`.
1719
///
1820
/// NOTE: When this function is invoked, it is on the stack of the new process, not the scheduler.
21+
#[allow(improper_ctypes_definitions)]
1922
pub(crate) extern "C-unwind" fn start() -> ErlangResult {
2023
scheduler::with_current_process(|process| {
2124
let argv = env::argv();

runtimes/tiny/src/intrinsic/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub unsafe extern "C-unwind" fn process_yield() -> bool {
7979
scheduler::with_current(|scheduler| scheduler.process_yield())
8080
}
8181

82+
#[allow(improper_ctypes_definitions)]
8283
#[export_name = "__lumen_builtin_exit"]
8384
pub unsafe extern "C-unwind" fn process_exit(result: ErlangResult) {
8485
scheduler::with_current(|scheduler| {

0 commit comments

Comments
 (0)