From a034e4549d48c1c0137b2594e66fb06249be6416 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Mon, 9 Mar 2015 00:23:00 +0100 Subject: [PATCH 1/2] add cbool rfc --- text/0000-cbool.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 text/0000-cbool.md diff --git a/text/0000-cbool.md b/text/0000-cbool.md new file mode 100644 index 00000000000..a31cae54adb --- /dev/null +++ b/text/0000-cbool.md @@ -0,0 +1,28 @@ +- Feature Name: cbool +- Start Date: Mon Mar 9 00:16:53 CET 2015 +- RFC PR: (leave this empty) +- Rust Issue: (leave this empty) + +# Summary + +Specify that `bool` is compatible with the `_Bool` C type. + +# Motivation + +You cannot safely call ffi functions with boolean arguments without a compatible type. + +# Detailed design + +Specify that `bool` is compatible with the `_Bool` C type and inform the compiler that `bool` is ffi safe. + +# Drawbacks + +None right now. This should be a no-op on all supported platforms. + +# Alternatives + +Define `_Bool` as a platform dependent integer type. This is unsafe because the behavior is supposedly undefined if you pass a value other than 0 or 1 to such a function. + +# Unresolved questions + +None. From c95bba1a1db82775f17e4bbef53b3c551acf5d37 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 14 Mar 2015 07:24:11 +0100 Subject: [PATCH 2/2] fixup --- text/0000-cbool.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/text/0000-cbool.md b/text/0000-cbool.md index a31cae54adb..d7ca590c0ee 100644 --- a/text/0000-cbool.md +++ b/text/0000-cbool.md @@ -9,15 +9,16 @@ Specify that `bool` is compatible with the `_Bool` C type. # Motivation -You cannot safely call ffi functions with boolean arguments without a compatible type. +You cannot safely call ffi functions with boolean arguments without a compatible +type. # Detailed design -Specify that `bool` is compatible with the `_Bool` C type and inform the compiler that `bool` is ffi safe. +Specify that `bool` is compatible with the `_Bool` C type. # Drawbacks -None right now. This should be a no-op on all supported platforms. +None. # Alternatives