[hackers] [scc] Add size in array declarations || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 18 Jul 2015 10:56:27 +0200 (CEST)

commit 9051e2b39dc3488b33c454ec375465471f3c3eb6
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Jul 18 10:54:18 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Jul 18 10:54:18 2015 +0200

    Add size in array declarations
    
    At this point this is not a big help, because the type
    declared in this way is a not define type, so it cannot
    be used to declare variables, and arrays cannot be used
    in castig.

diff --git a/cc1/decl.c b/cc1/decl.c
index ded6ee4..565b5f3 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -39,8 +39,14 @@ queue(struct dcldata *dp, unsigned op, short nelem, void *data)
 static struct dcldata *
 arydcl(struct dcldata *dp)
 {
+ Node *np = NULL;
+
         expect('[');
+ np = (yytoken != ']') ? constexpr() : NULL;
         expect(']');
+ /*
+ * TODO: Evaluate np.
+ */
         return queue(dp, ARY, 0, NULL);
 }
 
Received on Sat Jul 18 2015 - 10:56:27 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 18 2015 - 11:00:15 CEST