summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-08 17:22:29 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-08 17:22:29 -0400
commitee3fff389fbe2e2ba7776e4e24d91d95e01672ba (patch)
treed095aa9707fa95160f3afe14de2a90db9313e982 /cgen.c
parenta4a3e4a69499bf967d593572f4cddd3956b393c2 (diff)
debug and release builds; reading files still not fully tested
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cgen.c b/cgen.c
index 2fd5cbf..b27f2fa 100644
--- a/cgen.c
+++ b/cgen.c
@@ -121,7 +121,7 @@ static inline void cgen_char(CGenerator *g, char c) {
if (isprint(c) && c != '"')
cgen_write(g, "%c", c);
else
- cgen_write(g, "\\x%02x", c);
+ cgen_write(g, "\\%03o", c); /* can't use hex escape sequences, because they can be more than 2 characters "\xbafoo" is '\xbaf', 'o', 'o' */
}
/* should this declaration be a direct function declaration C? (as opposed to using a function pointer or not being a function) */
static bool cgen_fn_is_direct(CGenerator *g, Declaration *d) {
@@ -1250,6 +1250,9 @@ static void cgen_expr(CGenerator *g, Expression *e) {
case BUILTIN_PLATFORM:
cgen_write(g, "platform__");
break;
+ case BUILTIN_DEBUG: /* substituted for its value */
+ assert(0);
+ break;
}
break;
case EXPR_CAST: {