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.
This commit is contained in:
Jan Nieuwenhuizen 2017-04-10 08:06:33 +02:00
parent d7797ad2cf
commit c4b14d66d3
3 changed files with 2 additions and 8 deletions

4
lib.c
View file

@ -86,11 +86,7 @@ display_helper (SCM x, int cont, char* sep, int fd)
case TFUNCTION:
{
fputs ("#<procedure ", fd);
#if __GNUC__
char const *p = "?";
#else
char *p = "?";
#endif
if (FUNCTION (x).name != 0)
p = FUNCTION (x).name;
fputs (p, fd);

View file

@ -1257,7 +1257,7 @@
((accu->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))

View file

@ -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;
}