URI:
       cc1: Use int for namespaces - scc - simple c99 compiler
  HTML git clone git://git.simple-cc.org/scc
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
   DIR commit 7dbb2d53125f9592cf579c0e948c56eb886a8a3c
   DIR parent 8e07fdb59f3eaca0e5e8ad160f4d2ae37270360e
  HTML Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
       Date:   Thu, 29 Jan 2026 20:22:24 +0100
       
       cc1: Use int for namespaces
       
       The code in decl.c was protecting against overflow using INT_MAX,
       but the Symbols and types were using unsigned char or char, that
       made mismatching when the lookup was performed.
       
       Diffstat:
         M src/cmd/scc-cc/cc1/cc1.h            |       4 ++--
         M src/cmd/scc-cc/cc1/decl.c           |       2 +-
       
       2 files changed, 3 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/src/cmd/scc-cc/cc1/cc1.h b/src/cmd/scc-cc/cc1/cc1.h
       @@ -312,7 +312,7 @@ struct builtin {
        
        struct type {
                unsigned char op;           /* type builder operator */
       -        unsigned char ns;           /* namespace for struct members */
       +        int ns;                     /* namespace for struct members */
                short id;                   /* type id, used in dcls */
                char letter;                /* letter of the type */
                unsigned char prop;         /* type properties */
       @@ -335,7 +335,7 @@ struct type {
        struct symbol {
                unsigned char ctx;
                unsigned char hide;
       -        char ns;
       +        int ns;
                unsigned short id;
                unsigned short flags;
                char *name;
   DIR diff --git a/src/cmd/scc-cc/cc1/decl.c b/src/cmd/scc-cc/cc1/decl.c
       @@ -751,7 +751,7 @@ newtag(void)
        {
                Symbol *sym;
                int ns, op, tag = yylval.token;
       -        static unsigned tpns = NS_STRUCTS;
       +        static int tpns = NS_STRUCTS;
        
                ns = namespace;
                namespace = NS_TAG;