From c4b14d66d341ca06c6c0e10ae0a8773b29a0f6fb Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 10 Apr 2017 08:06:33 +0200 Subject: [PATCH] mescc: Allow usage of const by ignoring. * module/language/c99/compiler.mes (ast->info): Support const declarations (by ignoring them). * lib.c (display_helper)[!__GNUC__]: Remove branch. * posix.c (write_byte)[!__GNUC__]: Likewise. --- lib.c | 4 ---- module/language/c99/compiler.mes | 4 ++-- posix.c | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib.c b/lib.c index e7ac71c8..ae523205 100644 --- a/lib.c +++ b/lib.c @@ -86,11 +86,7 @@ display_helper (SCM x, int cont, char* sep, int fd) case TFUNCTION: { fputs ("#ident info) name))))) ;; char *p = "t.c"; - ((decl (decl-spec-list (type-spec (fixed-type ,type))) (init-declr-list (init-declr (ptr-declr (pointer) (ident ,name)) (initzer (p-expr (string ,string)))))) + ((decl (decl-spec-list (type-spec (fixed-type ,type)) . _) (init-declr-list (init-declr (ptr-declr (pointer) (ident ,name)) (initzer (p-expr (string ,string)))))) (when (not (.function info)) (stderr "o=~s\n" o) decl-barf3) @@ -1271,7 +1271,7 @@ ((accu->ident info) name))))) ;; char *p = 0; - ((decl (decl-spec-list (type-spec (fixed-type ,type))) (init-declr-list (init-declr (ptr-declr (pointer) (ident ,name)) (initzer (p-expr (fixed ,value)))))) + ((decl (decl-spec-list (type-spec (fixed-type ,type)) . _) (init-declr-list (init-declr (ptr-declr (pointer) (ident ,name)) (initzer (p-expr (fixed ,value)))))) (let ((value (cstring->number value))) (if (.function info) (let* ((locals (add-local locals name type 1)) diff --git a/posix.c b/posix.c index 39abe7a8..6d9d0587 100644 --- a/posix.c +++ b/posix.c @@ -118,9 +118,7 @@ write_byte (SCM x) ///((arity . n)) char cc = VALUE (c); write (1, (char*)&cc, fd); #endif -#if __GNUC__ assert (TYPE (c) == TNUMBER || TYPE (c) == TCHAR); -#endif return c; }