aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2020-10-25 11:26:30 -0600
committerMelody Horn <melody@boringcactus.com>2020-10-25 11:26:30 -0600
commitd9fcad8cd6ec6f0469d25a1c6ad640d60a485d1c (patch)
tree9c968b7e01bb0d51ae0626d47f4f13fe878df720
parentf1fcbe3d5bf5158f39b89f0eb3677db50fb2f8fd (diff)
downloadspec-d9fcad8cd6ec6f0469d25a1c6ad640d60a485d1c.tar.gz
spec-d9fcad8cd6ec6f0469d25a1c6ad640d60a485d1c.zip
add fragile keyword
-rw-r--r--safety.md4
-rw-r--r--syntax.md1
-rw-r--r--vs-c.md2
3 files changed, 6 insertions, 1 deletions
diff --git a/safety.md b/safety.md
index 8a03652..b8a2303 100644
--- a/safety.md
+++ b/safety.md
@@ -1,5 +1,9 @@
Each item in Wikipedia's [list of types of memory errors](https://en.wikipedia.org/wiki/Memory_safety#Types_of_memory_errors) and what Crowbar does to prevent them.
+In general, Crowbar does its best to ensure that code will not exhibit any of the following memory errors.
+However, sometimes the compiler knows less than the programmer, and so code that looks dangerous is actually fine.
+Crowbar allows programmers to suspend the memory safety checks with the `fragile` keyword.
+
# Access errors
## Buffer overflow
diff --git a/syntax.md b/syntax.md
index 89c1c49..6413f8a 100644
--- a/syntax.md
+++ b/syntax.md
@@ -36,6 +36,7 @@ A *keyword* is one of the following literal words:
- `extern`
- `float`
- `for`
+- `fragile`
- `function`
- `if`
- `include`
diff --git a/vs-c.md b/vs-c.md
index bceaab1..b6cbcd5 100644
--- a/vs-c.md
+++ b/vs-c.md
@@ -45,7 +45,7 @@ Some type modifiers in C only apply in very specific circumstances and so aren't
Some C features are footguns by default, so Crowbar ensures that they are only used correctly.
- Unions are not robust by default.
- Crowbar only supports unions when they are [tagged unions](tagged-unions.md).
+ Crowbar only supports unions when they are [tagged unions](tagged-unions.md) (or declared and used with the `fragile` keyword).
C's syntax isn't perfect, but it's usually pretty good.
However, sometimes it just sucks, and in those cases Crowbar makes changes.