Delete old "assert.h" files; use libc <assert.h>.
authorGeorge Koehler <xkernigh@netscape.net>
Fri, 10 Nov 2017 03:22:13 +0000 (22:22 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Fri, 10 Nov 2017 03:22:13 +0000 (22:22 -0500)
Edit build.lua for programs losing their private assert.h, so they
depend on a list of .h files excluding assert.h.

Remove modules/src/assert; it would be a dependency of cpp.ansi but we
didn't build it, so cpp.ansi uses the libc assert.

I hope that libc <assert.h> can better report failed assertions.  Some
old "assert.h" files didn't report the expression.  Some reported a
literal "x", because traditional C expanded the macro parameter x in
"x", but ANSI C89 doesn't expand macro parameters in string literals.

57 files changed:
lang/cem/cemcom.ansi/LLlex.c
lang/cem/cemcom.ansi/arith.c
lang/cem/cemcom.ansi/assert.h [deleted file]
lang/cem/cemcom.ansi/build.lua
lang/cem/cemcom.ansi/ch3.c
lang/cem/cemcom.ansi/code.c
lang/cem/cemcom.ansi/cstoper.c
lang/cem/cemcom.ansi/decspecs.c
lang/cem/cemcom.ansi/domacro.c
lang/cem/cemcom.ansi/eval.c
lang/cem/cemcom.ansi/expr.c
lang/cem/cemcom.ansi/field.c
lang/cem/cemcom.ansi/fltcstoper.c
lang/cem/cemcom.ansi/idf.c
lang/cem/cemcom.ansi/interface.h
lang/cem/cemcom.ansi/ival.g
lang/cem/cemcom.ansi/l_ev_ord.c
lang/cem/cemcom.ansi/l_lint.c
lang/cem/cemcom.ansi/l_outdef.c
lang/cem/cemcom.ansi/l_states.c
lang/cem/cemcom.ansi/main.c
lang/cem/cemcom.ansi/proto.c
lang/cem/cemcom.ansi/replace.c
lang/cem/cemcom.ansi/struct.c
lang/cem/cemcom.ansi/switch.c
lang/cem/cpp.ansi/build.lua
lang/cem/cpp.ansi/replace.c
modules/src/assert/BadAssert.c [deleted file]
modules/src/assert/assert.3 [deleted file]
modules/src/assert/assert.h [deleted file]
modules/src/assert/build.lua [deleted file]
util/led/assert.h [deleted file]
util/led/build.lua
util/led/memory.c
util/led/save.c
util/led/scan.c
util/led/write.c
util/ncgg/assert.h [deleted file]
util/ncgg/build.lua
util/ncgg/coerc.c
util/ncgg/error.c
util/ncgg/expr.c
util/ncgg/hall.c
util/ncgg/iocc.c
util/ncgg/lookup.c
util/ncgg/output.c
util/opt/alloc.c
util/opt/assert.h [deleted file]
util/opt/backward.c
util/opt/build.lua
util/opt/cleanup.c
util/opt/peephole.c
util/opt/process.c
util/opt/putline.c
util/opt/reg.c
util/opt/tes.c
util/opt/util.c

index d063253..a25098e 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*                 L E X I C A L   A N A L Y Z E R                     */
 
+#include       <assert.h>
 #include       <alloc.h>
 #include    "parameters.h"
 #include       "input.h"
@@ -15,7 +16,6 @@
 #include       "LLlex.h"
 #include       "Lpars.h"
 #include       "class.h"
-#include       "assert.h"
 #include       "sizes.h"
 #include       "specials.h"    /* registration of special identifiers */
 
@@ -61,15 +61,15 @@ void skipcomment();
 */
 PushLex()
 {
-       ASSERT(LexSP < MAX_LL_DEPTH);
-       ASSERT(ASIDE == 0);     /* ASIDE = 0;   */
+       assert(LexSP < MAX_LL_DEPTH);
+       assert(ASIDE == 0);     /* ASIDE = 0;   */
        GetToken(&ahead);
        LexStack[LexSP++] = dot;
 }
 
 PopLex()
 {
-       ASSERT(LexSP > 0);
+       assert(LexSP > 0);
        dot = LexStack[--LexSP];
 }
 #endif /* NOPP */
@@ -765,7 +765,7 @@ struct token *ptok;
        int uns_flg = 0, lng_flg = 0, malformed = 0, ovfl = 0;
        int fund;
 
-       ASSERT(*cp != '-');
+       assert(*cp != '-');
        if (*cp == '0') {
                cp++;
                if (*cp == 'x' || *cp == 'X') {
@@ -828,7 +828,7 @@ struct token *ptok;
                if (val >= 0) fund = LONG;
                else fund = ULONG;
        } else {        /* sizeof(arith) is greater than long_size */
-               ASSERT(arith_size > long_size);
+               assert(arith_size > long_size);
                lexwarning("constant too large for target machine");
                /* cut the size to prevent further complaints */
                val &= full_mask[(int)long_size];
index 317107a..b402e4b 100644 (file)
@@ -11,6 +11,7 @@
        semantics of C is a mess.
 */
 
+#include       <assert.h>
 #include    "parameters.h"
 #include       <alloc.h>
 #include       <flt_arith.h>
@@ -23,7 +24,6 @@
 #include       "Lpars.h"
 #include       "field.h"
 #include       "mes.h"
-#include       "assert.h"
 
 extern char *symbol2str();
 extern char options[];
@@ -250,7 +250,7 @@ any2arith(expp, oper)
        switch (fund = (*expp)->ex_type->tp_fund)       {
        case CHAR:
        case SHORT:
-               ASSERT((*expp)->ex_type->tp_size <= int_type->tp_size);
+               assert((*expp)->ex_type->tp_size <= int_type->tp_size);
 
                if ((*expp)->ex_type->tp_unsigned
                    && (*expp)->ex_type->tp_size == int_type->tp_size) {
diff --git a/lang/cem/cemcom.ansi/assert.h b/lang/cem/cemcom.ansi/assert.h
deleted file mode 100644 (file)
index da650da..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
-
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id$ */
-/*      A S S E R T I O N    M A C R O   D E F I N I T I O N           */
-
-/*     At some points in the program, it must be sure that some condition
-       holds true, due to further, successful, processing.  As long as
-       there is no reasonable method to prove that a program is 100%
-       correct, these assertions are needed in some places.
-*/
-
-#include       "parameters.h"
-
-#ifdef DEBUG
-/*     Note: this macro uses parameter substitution inside strings */
-#define        ASSERT(exp)     (exp || crash("in %s, %u: assertion %s failed", \
-                               __FILE__, __LINE__, "exp"))
-#define        NOTREACHED()    crash("in %s, %u: unreachable statement reached", \
-                               __FILE__, __LINE__)
-#else
-#define        ASSERT(exp)
-#define        NOTREACHED()
-#endif /* DEBUG */
index 670c73a..35ecbe3 100644 (file)
@@ -138,7 +138,12 @@ cprogram {
                matching(filenamesof("+llgen"), "%.c$"),
        },
        deps = {
-               "./*.h",
+               "./LLlex.h", "./align.h", "./arith.h", "./atw.h",
+               "./class.h", "./decspecs.h", "./file_info.h",
+               "./input.h", "./interface.h", "./l_class.h",
+               "./l_comment.h", "./l_em.h", "./l_lint.h",
+               "./label.h", "./level.h", "./mes.h", "./sizes.h",
+               "./specials.h", "./tokenname.h",
                "+llgen",
                "+nextlib",
                "+parameters",
index eef8067..5354269 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*     S E M A N T I C   A N A L Y S I S -- C H A P T E R  3.3         */
 
+#include       <assert.h>
 #include       "parameters.h"
 #include       <flt_arith.h>
 #include       "arith.h"
@@ -16,7 +17,6 @@
 #include       "expr.h"
 #include       "def.h"
 #include       "Lpars.h"
-#include       "assert.h"
 #include       "file_info.h"
 
 extern char options[];
@@ -119,7 +119,7 @@ ch3sel(expp, oper, idf)
                        struct oper *op = &(exp->ex_object.ex_oper);
                        
                        if (op->op_oper == '.' || op->op_oper == ARROW) {
-                               ASSERT(is_cp_cst(op->op_right));
+                               assert(is_cp_cst(op->op_right));
                                op->op_right->VL_VALUE += sd->sd_offset;
                                exp->ex_type = sd->sd_type;
                                exp->ex_lvalue = exp->ex_type->tp_fund != ARRAY;
@@ -528,7 +528,7 @@ legal_mixture(tp, otp, diag)
        register struct proto *prot;
        int fund;
 
-       ASSERT( (pl != 0) ^ (opl != 0));
+       assert( (pl != 0) ^ (opl != 0));
        if (pl)  {
                prot = pl;
        } else  {
@@ -592,7 +592,7 @@ int qual;
 {
        register struct sdef *sdf;
 
-       ASSERT(tp);
+       assert(tp);
 
        if (tp->tp_typequal & qual) return 1;
        switch(tp->tp_fund) {
index abfd2b2..a6a898a 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*     C O D E - G E N E R A T I N G   R O U T I N E S         */
 
+#include       <assert.h>
 #include       <stdlib.h>
 #include       <string.h>
 #include       "parameters.h"
@@ -32,7 +33,6 @@
 #include       "Lpars.h"
 #include       "specials.h"
 #include       "atw.h"
-#include       "assert.h"
 #include       "LLlex.h"
 #include       "align.h"
 #ifdef LINT
@@ -545,7 +545,7 @@ loc_init(expr, id)
        static arith tmpoffset = 0;
        static arith unknownsize = 0;
        
-       ASSERT(df->df_sc != STATIC);
+       assert(df->df_sc != STATIC);
        switch (tp->tp_fund)    {
        case ARRAY:
                if (tp->tp_size == (arith) -1)
index f904d91..a63103b 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*     C O N S T A N T   E X P R E S S I O N   H A N D L I N G         */
 
+#include       <assert.h>
 #include    "parameters.h"
 #include       <flt_arith.h>
 #include       "arith.h"
@@ -13,7 +14,6 @@
 #include       "expr.h"
 #include       "sizes.h"
 #include       "Lpars.h"
-#include       "assert.h"
 
 /* full_mask[1] == 0XFF, full_mask[2] == 0XFFFF, .. */
 arith full_mask[MAXSIZE + 1];
@@ -34,7 +34,7 @@ cstbin(expp, oper, expr)
        register arith o2 = expr->VL_VALUE;
        int uns = (*expp)->ex_type->tp_unsigned;
 
-       ASSERT(is_ld_cst(*expp) && is_cp_cst(expr));
+       assert(is_ld_cst(*expp) && is_cp_cst(expr));
        switch (oper)   {
        case '*':
                o1 *= o2;
@@ -144,7 +144,7 @@ cut_size(expr)
        int uns = expr->ex_type->tp_unsigned;
        int size = (int) expr->ex_type->tp_size;
 
-       ASSERT(expr->ex_class == Value);
+       assert(expr->ex_class == Value);
        if (expr->ex_type->tp_fund == POINTER) {
                /* why warn on "ptr-3" ?
                   This quick hack fixes it
index f7093da..bef0c0d 100644 (file)
@@ -5,7 +5,7 @@
 /* $Id$ */
 /*     D E C L A R A T I O N   S P E C I F I E R   C H E C K I N G     */
 
-#include       "assert.h"
+#include       <assert.h>
 #include       "Lpars.h"
 #include       "decspecs.h"
 #include       "arith.h"
@@ -28,7 +28,7 @@ do_decspecs(ds)
        */
        register struct type *tp = ds->ds_type;
        
-       ASSERT(level != L_FORMAL1);
+       assert(level != L_FORMAL1);
        
        if (    level == L_GLOBAL &&
                (ds->ds_sc == AUTO || ds->ds_sc == REGISTER)
index d0fe7a9..412ab30 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /* PREPROCESSOR: CONTROLLINE INTERPRETER */
 
+#include       <assert.h>
 #include    <stdlib.h>
 #include       "parameters.h"
 #include    "idf.h"
@@ -15,7 +16,6 @@
 #include    "replace.h"
 
 #ifndef NOPP
-#include       "assert.h"
 #include       <alloc.h>
 #include       "class.h"
 #include       "macro.h"
@@ -263,7 +263,7 @@ int to_endif;
                        else SkipToNewLine();
                        break;
                case K_ENDIF:
-                       ASSERT(nestlevel > nestlow);
+                       assert(nestlevel > nestlow);
                        if (nestlevel == skiplevel) {
                                if (SkipToNewLine()) {
                                        if (!options['o'])
@@ -383,7 +383,7 @@ do_define()
        }
        /* read the replacement text if there is any                    */
        ch = skipspaces(ch,0);  /* find first character of the text     */
-       ASSERT(ch != EOI);
+       assert(ch != EOI);
        /* UnGetChar() is not right when replacement starts with a '/' */
        ChPushBack(ch);
        repl_text = get_text((nformals > 0) ? formals : 0, &length);
index f678682..22d5c08 100644 (file)
@@ -8,6 +8,7 @@
 #include       "parameters.h"
 #ifndef        LINT
 
+#include       <assert.h>
 #include       <em.h>
 #include       <em_reg.h>
 #include       <alloc.h>
@@ -17,7 +18,6 @@
 #include       "type.h"
 #include       "label.h"
 #include       "code.h"
-#include       "assert.h"
 #include       "def.h"
 #include       "expr.h"
 #include       "sizes.h"
@@ -83,7 +83,7 @@ EVAL(expr, val, code, true_label, false_label)
                                /* can only result from ','-expressions with
                                   constant right-hand sides ???
                                */
-                               ASSERT(is_cp_cst(expr));
+                               assert(is_cp_cst(expr));
                                C_bra(expr->VL_VALUE == 0 ? false_label : true_label);
                        }
                        else load_val(expr, val);
@@ -254,7 +254,7 @@ EVAL(expr, val, code, true_label, false_label)
                        break;
                case '%':
                        operands(expr, gencode);
-                       ASSERT(tp->tp_fund==INT || tp->tp_fund==LONG);
+                       assert(tp->tp_fund==INT || tp->tp_fund==LONG);
                        if (gencode)
                                if (tp->tp_unsigned)
                                        C_rmu(tp->tp_size);
@@ -554,7 +554,7 @@ EVAL(expr, val, code, true_label, false_label)
                                fp_used = 1;
                        EVAL(left, oper == '.' ? LVAL : RVAL, gencode,
                                NO_LABEL, NO_LABEL);
-                       ASSERT(is_cp_cst(right));
+                       assert(is_cp_cst(right));
                        if (gencode) {
                                C_adp(right->VL_VALUE);
                        }
@@ -877,7 +877,7 @@ store_val(vl, tp)
                        }
                }
                else {
-                       ASSERT(df->df_sc != STATIC);
+                       assert(df->df_sc != STATIC);
                        if (inword || indword)
                                StoreLocal(df->df_address + val, tp->tp_size);
                        else {
@@ -889,7 +889,7 @@ store_val(vl, tp)
        else {  
                label dlb = vl->vl_data.vl_lbl;
 
-               ASSERT(vl->vl_class == Label);
+               assert(vl->vl_class == Label);
                if (inword)
                        C_ste_dlb(dlb, val);
                else
@@ -964,12 +964,12 @@ load_val(expr, rlval)
                register struct def *df = id->id_def;
                int fund = df->df_type->tp_fund;
 
-               ASSERT(ISNAME(expr));
+               assert(ISNAME(expr));
                if (fund == FUNCTION) {
                        /*      the previous statement tried to catch a function
                                identifier, which may be cast to a pointer to a
                                function.
-                               ASSERT(!(rvalue)); ???
+                               assert(!(rvalue)); ???
                        */
                        C_lpi(id->id_text);
                }
@@ -995,7 +995,7 @@ load_val(expr, rlval)
                        }
                }
                else {
-                       /* ASSERT(df->df_sc != STATIC); */
+                       /* assert(df->df_sc != STATIC); */
                        if (rvalue) {
                                if (inword || indword)
                                        LoadLocal(df->df_address + val, tp->tp_size);
index 3a7e3c4..7b686c3 100644 (file)
@@ -5,9 +5,9 @@
 /* $Id$ */
 /* EXPRESSION TREE HANDLING */
 
+#include       <assert.h>
 #include    <stdlib.h>
 #include       "parameters.h"
-#include       "assert.h"
 #include       <alloc.h>
 #include       <flt_arith.h>
 #include    "idf.h"
@@ -251,7 +251,7 @@ float2expr(expr)
        expr->ex_class = Float;
        flt_str2flt(dot.tk_fval, &(expr->FL_ARITH));
        free(dot.tk_fval);
-       ASSERT(flt_status != FLT_NOFLT);
+       assert(flt_status != FLT_NOFLT);
        if (flt_status == FLT_OVFL)
                expr_warning(expr,"internal floating point overflow");
 }
index 1514942..f5635d1 100644 (file)
@@ -10,6 +10,7 @@
 
 
 #ifndef NOBITFIELD
+#include       <assert.h>
 #include       <em.h>
 #include       <em_reg.h>
 #include       <flt_arith.h>
@@ -17,7 +18,6 @@
 #include       "type.h"
 #include       "label.h"
 #include       "code.h"
-#include       "assert.h"
 #include       "expr.h"
 #include       "sizes.h"
 #include       "align.h"
@@ -55,12 +55,12 @@ eval_field(expr, code)
                                    : word_type;
 
        /* First some assertions to be sure that the rest is legal */
-       ASSERT(atype->tp_size == word_size);    /* make sure that C_loc() is legal */
-       ASSERT(leftop->ex_type->tp_fund == FIELD);
+       assert(atype->tp_size == word_size);    /* make sure that C_loc() is legal */
+       assert(leftop->ex_type->tp_fund == FIELD);
        leftop->ex_type = atype;        /* this is cheating but it works... */
        if (op == '=') {
                /* F = E: f = ((E & mask)<<shift) | (~(mask<<shift) & f) */
-               ASSERT(tp == rightop->ex_type);
+               assert(tp == rightop->ex_type);
                EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
                conversion(tp, atype);
                store_field(fd, tp->tp_unsigned, code, leftop, (arith) 0);
index de4d26e..7b48fc7 100644 (file)
@@ -6,8 +6,8 @@
 /*     C O N S T A N T   E X P R E S S I O N   H A N D L I N G         */
 /*       F O R   F L O A T I N G   P O I N T   N U M B E R S           */
 
+#include       <assert.h>
 #include       "parameters.h"
-#include       "assert.h"
 #include       <alloc.h>
 #include       <flt_arith.h>
 #include       "arith.h"
@@ -34,7 +34,7 @@ fltcstbin(expp, oper, expr)
        o1 = (*expp)->FL_ARITH;
        o2 = expr->FL_ARITH;
 
-       ASSERT(is_fp_cst(*expp) && is_fp_cst(expr));
+       assert(is_fp_cst(*expp) && is_fp_cst(expr));
        switch (oper)   {
        case '*':
                flt_mul(&o1, &o2, &o1);
index 4edc884..5472722 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*     IDENTIFIER  FIDDLING & SYMBOL TABLE HANDLING    */
 
+#include       <assert.h>
 #include       <stdlib.h>
 #include       <string.h>
 #include       "parameters.h"
@@ -25,7 +26,6 @@
 #include       "decspecs.h"
 #include       "sizes.h"
 #include       "Lpars.h"
-#include       "assert.h"
 
 extern char options[];
 extern arith NewLocal();
@@ -88,7 +88,7 @@ declare_idf(ds, dc, lvl)
        if (ds->ds_type == 0)   {
                /*      at the L_FORMAL1 level there is no type specified yet
                */
-               ASSERT(lvl == L_FORMAL1);
+               assert(lvl == L_FORMAL1);
                type = int_type;        /* may change at L_FORMAL2 */
        }
        else    {
@@ -224,7 +224,7 @@ declare_idf(ds, dc, lvl)
                        So here we hand out local addresses only.
                */
                if (lvl >= L_LOCAL)     {
-                       ASSERT(sc);
+                       assert(sc);
                        switch (sc)     {
                        case REGISTER:
                        case AUTO:
@@ -380,7 +380,7 @@ good_formal(def, idf)
                        error("%s not in parameter list", idf->id_text);
                return 0;
        }
-       ASSERT(def->df_sc == FORMAL);   /* CJ */
+       assert(def->df_sc == FORMAL);   /* CJ */
        return 1;
 }
 
index 4967e55..72c1064 100644 (file)
@@ -6,3 +6,11 @@
 #define PRIVATE        static          /* or not */
 #define IMPORT extern
 #define EXPORT
+
+/* Here to avoid creating another header "notreached.h" */
+#ifndef NDEBUG
+#define        NOTREACHED()    crash("in %s, %u: unreachable statement reached", \
+                               __FILE__, __LINE__)
+#else
+#define NOTREACHED()
+#endif /* NDEBUG */
index 757bb72..69239c4 100644 (file)
@@ -6,6 +6,7 @@
 /* CODE FOR THE INITIALISATION OF GLOBAL VARIABLES */
 
 {
+#include       <assert.h>
 #include    <stdlib.h>
 #include       "parameters.h"
 #ifndef        LINT
@@ -25,7 +26,6 @@
 #include       "proto.h"
 #include       "struct.h"
 #include       "field.h"
-#include       "assert.h"
 #include       "Lpars.h"
 #include       "sizes.h"
 #include       "align.h"
@@ -548,7 +548,7 @@ check_ival(expp, tp)
                                C_con_dnam(idf->id_text, expr->VL_VALUE);
                }
                else {
-                       ASSERT(expr->VL_CLASS == Label);
+                       assert(expr->VL_CLASS == Label);
                        C_con_dlb(expr->VL_LBL, expr->VL_VALUE);
                }
                break;
@@ -625,7 +625,7 @@ ch_array(tpp, ex)
        register int length = ex->SG_LEN, i;
        register char *to, *from, *s;
 
-       ASSERT(ex->ex_class == String);
+       assert(ex->ex_class == String);
        if (tp->tp_size == (arith)-1) {
                /* set the dimension    */
                tp = *tpp = construct_type(ARRAY, tp->tp_up, 0, (arith)length, NO_PROTO);
@@ -696,7 +696,7 @@ put_bf(tp, val)
        register struct sdef *sd =  fd->fd_sdef;
        static struct expr exp;
 
-       ASSERT(sd);
+       assert(sd);
        if (offset == (arith)-1) {
                /* first bitfield in this field */
                offset = sd->sd_offset;
@@ -737,7 +737,7 @@ valid_type(tp, str)
        struct type *tp;
        char *str;
 {
-       ASSERT(tp!=(struct type *)0);
+       assert(tp!=(struct type *)0);
        if (tp->tp_size < 0) {
                error("size of %s unknown", str);
                return 0;
@@ -750,7 +750,7 @@ con_int(ex)
 {
        register struct type *tp = ex->ex_type;
 
-       ASSERT(is_cp_cst(ex));
+       assert(is_cp_cst(ex));
        if (tp->tp_unsigned)
                C_con_ucon(long2str((long)ex->VL_VALUE, -10), tp->tp_size);
        else if (tp->tp_size == word_size)
index c5d7550..fe43a83 100644 (file)
@@ -11,7 +11,6 @@
 
 #include       <alloc.h>       /* for st_free */
 #include       "interface.h"
-#include       "assert.h"
 #ifdef ANSI
 #include       <flt_arith.h>
 #endif /* ANSI */
index 5f95cb0..e2a5ea8 100644 (file)
@@ -9,9 +9,9 @@
 
 #ifdef LINT
 
+#include       <assert.h>
 #include       <alloc.h>       /* for st_free */
 #include       "interface.h"
-#include       "assert.h"
 #ifdef ANSI
 #include       <flt_arith.h>
 #endif /* ANSI */
@@ -365,7 +365,7 @@ add_expr_state(value, to_state, espp)
 {
        register struct expr_state *esp = *espp;
 
-       ASSERT(value.vl_class == Name);
+       assert(value.vl_class == Name);
 
        /* try to find the esp */
        while ( esp
index aab98a5..773b068 100644 (file)
@@ -9,13 +9,13 @@
 
 #ifdef LINT
 
+#include       <assert.h>
 #include       <alloc.h>
 #include       "interface.h"
 #ifdef ANSI
 #include       <flt_arith.h>
 #endif /* ANSI */
 #include       "arith.h"
-#include       "assert.h"
 #include       "type.h"
 #include       "proto.h"
 #include       "declar.h"
@@ -384,7 +384,7 @@ outargs(arg, n)
        register struct argument *tmp;
 
        while (n--) {
-               ASSERT(arg);
+               assert(arg);
                outarg(arg);
                tmp = arg;
                arg = arg->next;
index 74d31b3..506b3e4 100644 (file)
@@ -9,9 +9,9 @@
 
 #ifdef LINT
 
+#include       <assert.h>
 #include       <alloc.h>       /* for st_free */
 #include       "interface.h"
-#include       "assert.h"
 #ifdef ANSI
 #include       <flt_arith.h>
 #endif /* ANSI */
@@ -179,7 +179,7 @@ lint_end_global(stl)
        register struct stack_entry *se = stl->sl_entry;
 
        dbg_lint_stack("lint_end_global");
-       ASSERT(level == L_GLOBAL);
+       assert(level == L_GLOBAL);
        while (se) {
                register struct idf *idf = se->se_idf;
                register struct def *def = idf->id_def;
@@ -275,7 +275,7 @@ change_state(idf, to_state)
        register struct def *def = idf->id_def;
        register struct auto_def *a = top_ls->ls_current->st_auto_list;
 
-       ASSERT(def);
+       assert(def);
 
        switch (to_state) {
        case SET:
@@ -300,7 +300,7 @@ change_state(idf, to_state)
                while (br && br->br_count > def->df_firstbrace) {
                        br = br->next;
                }
-               ASSERT(br && def->df_minlevel >= br->br_level);
+               assert(br && def->df_minlevel >= br->br_level);
                def->df_minlevel = br->br_level;
        }
 
@@ -340,7 +340,7 @@ add_auto(idf)       /* to current state on top of lint_stack */
  */
        register struct def *def = idf->id_def;
 
-       ASSERT(def);
+       assert(def);
 
        switch (def->df_sc) {
                register struct auto_def *a;
@@ -369,7 +369,7 @@ check_autos()
  */
        register struct auto_def *a = top_ls->ls_current->st_auto_list;
 
-       ASSERT(!(a && a->ad_def->df_level > level));
+       assert(!(a && a->ad_def->df_level > level));
        while (a && a->ad_def->df_level == level) {
                struct idf *idf = a->ad_idf;
                struct def *def = idf->id_def;
@@ -401,7 +401,7 @@ lint_end_formals()
        register struct stack_entry *se = local_level->sl_entry;
 
        dbg_lint_stack("lint_end_formals");
-       ASSERT(level == L_FORMAL1);
+       assert(level == L_FORMAL1);
        while (se) {
                register struct def *def = se->se_idf->id_def;
 
@@ -581,10 +581,10 @@ merge_autos(a1, a2, lvl, mode)
 
        a = a2; /* pointer to the result */
        while (a1) {
-               ASSERT(a2);
+               assert(a2);
 
                /* merge the auto_defs for one idf */
-               ASSERT(a1->ad_idf == a2->ad_idf);
+               assert(a1->ad_idf == a2->ad_idf);
                if (a1->ad_used)
                        a2->ad_used = 1;
 
@@ -605,7 +605,7 @@ merge_autos(a1, a2, lvl, mode)
                a1 = a1->next;
                a2 = a2->next;
        }
-       ASSERT(!a2);
+       assert(!a2);
        return a;
 }
 
@@ -806,7 +806,7 @@ end_loop_body()
        register struct lint_stack_entry *lse = find_wdf();
 
        dbg_lint_stack("end_loop_body");
-       ASSERT(lse == top_ls);
+       assert(lse == top_ls);
        if (!lse->ls_current->st_notreached)
                cont_merge(lse);
 }
@@ -816,7 +816,7 @@ end_loop_stmt()
        register struct lint_stack_entry *lse = find_wdf();
 
        dbg_lint_stack("end_loop_stmt");
-       ASSERT(lse == top_ls);
+       assert(lse == top_ls);
        if (lse->LS_TEST != TEST_TRUE)
                break_merge(lse);
 
@@ -958,7 +958,7 @@ lint_case_stmt(dflt)
                break;
 
        case CASE:
-               ASSERT(top_ls->ls_previous->ls_class == SWITCH);
+               assert(top_ls->ls_previous->ls_class == SWITCH);
                if (dflt) {
                        cs_entry->ls_previous->LS_DEFAULT_MET = 1;
                }
@@ -1079,7 +1079,7 @@ lint_end_function()
         * These auto_defs must be freed and the state must be filled
         * with zeros.
         */
-       ASSERT(!top_ls->ls_previous);
+       assert(!top_ls->ls_previous);
        free_auto_list(top_ls->ls_current->st_auto_list);
        top_ls->ls_current->st_auto_list = 0;
        top_ls->ls_current->st_notreached = 0;
index 1bb72ae..00e7eb3 100644 (file)
@@ -22,7 +22,6 @@
 #include       "sizes.h"
 #include       "align.h"
 #include       "macro.h"
-#include       "assert.h"
 
 extern struct tokenname tkidf[];
 extern char *symbol2str();
index b237f34..ff99ba9 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*  P R O T O T Y P E   F I D D L I N G  */
 
+#include       <assert.h>
 #include       "parameters.h"
 #include       <alloc.h>
 #include    "idf.h"
@@ -22,7 +23,6 @@
 #include       "declar.h"
 #include       "decspecs.h"
 #include       "proto.h"
-#include       "assert.h"
 
 extern char options[];
 
@@ -65,7 +65,7 @@ add_proto(pl, ds, dc, lvl)
        register struct type *type;
        char formal_array = 0;
 
-       ASSERT(ds->ds_type != (struct type *)0);
+       assert(ds->ds_type != (struct type *)0);
 
        pl->pl_flag = PL_FORMAL;
        type = declare_type(ds->ds_type, dc);
index 11908e5..e29412d 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*  M A C R O   R E P L A C E M E N T */
 
+#include       <assert.h>
 #include       <stdlib.h>
 #include       <string.h>
 #include       "parameters.h"
@@ -18,7 +19,6 @@
 #include       "arith.h"
 #include       "LLlex.h"
 #include       "class.h"
-#include       "assert.h"
 #include       "replace.h"
 
 extern struct idf *GetIdentifier();
@@ -85,7 +85,7 @@ EnableMacros()
 {
        register struct repl *r = ReplaceList, *prev = 0;
 
-       ASSERT(Unstacked > 0);
+       assert(Unstacked > 0);
        while(r) {
                struct repl *nxt = r->next;
 
@@ -131,7 +131,7 @@ expand_macro(repl, idf)
        if (mac->mc_nps != -1) {        /* with parameter list  */
                if (mac->mc_flag & FUNC) {
                        /* the following assertion won't compile:
-                       ASSERT(!strcmp("defined", idf->id_text));
+                       assert(!strcmp("defined", idf->id_text));
                        expand the assert macro by hand (??? dirty, temporary)
                        */
 #ifdef DEBUG
@@ -199,7 +199,7 @@ expand_defined(repl)
        }
        ChPushBack(ch);
        id = GetIdentifier(0);
-       ASSERT(id || class(ch) == STELL);
+       assert(id || class(ch) == STELL);
        ch = GetChar();
        ch = skipspaces(ch, 0);
        if (parens && ch != ')') error(") missing");
@@ -571,7 +571,7 @@ macro2buffer(repl, idf, args)
        int func = idf->id_macro->mc_nps != -1;
        char *stringify();
 
-       ASSERT(ptr[idf->id_macro->mc_length] == '\0');
+       assert(ptr[idf->id_macro->mc_length] == '\0');
        while (*ptr) {
            if (*ptr == '\'' || *ptr == '"') {
                register int delim = *ptr;
@@ -624,7 +624,7 @@ macro2buffer(repl, idf, args)
                        register int n = *ptr++ & 0177;
                        register char *p;
 
-                       ASSERT(n > 0);
+                       assert(n > 0);
                        p = args->a_rawvec[n-1];
                        if (p) {        /* else macro argument missing */
                            while (is_wsp(*p)) p++;
@@ -660,7 +660,7 @@ macro2buffer(repl, idf, args)
                register int n = *ptr++ & 0177;
                register char *p, *q;
 
-               ASSERT(n > 0);
+               assert(n > 0);
 
                /*      This is VERY dirty, we look ahead for the
                        ## operator. If it's found we use the raw
@@ -718,7 +718,7 @@ stringify(repl, ptr, args)
                register int n = *ptr++ & 0177;
                register char *p;
 
-               ASSERT(n != 0);
+               assert(n != 0);
                p = args->a_rawvec[n-1];
                add2repl(repl, '"');
                while (*p) {
@@ -761,7 +761,7 @@ add2repl(repl, ch)
 {
        register int index = repl->r_ptr - repl->r_text;
 
-       ASSERT(index < repl->r_size);
+       assert(index < repl->r_size);
        if (index + 2 >= repl->r_size) {
                repl->r_text = Realloc(repl->r_text, (unsigned) (repl->r_size <<= 1));
                repl->r_ptr = repl->r_text + index;
@@ -785,7 +785,7 @@ stash(repl, ch, stashraw)
        register int index = args->a_expptr - args->a_expbuf;
 
        if (stashraw >= 0) {
-               ASSERT(index < args->a_expsize);
+               assert(index < args->a_expsize);
                if (index + 1 >= args->a_expsize) {
                        args->a_expbuf = Realloc(args->a_expbuf,
                                                    (unsigned) (args->a_expsize <<= 1));
@@ -796,7 +796,7 @@ stash(repl, ch, stashraw)
 
        if (stashraw) {
                index = args->a_rawptr - args->a_rawbuf;
-               ASSERT(index < args->a_rawsize);
+               assert(index < args->a_rawsize);
                if (index + 1 >= args->a_rawsize) {
                        args->a_rawbuf = Realloc(args->a_rawbuf,
                                                    (unsigned)(args->a_rawsize <<= 1));
index 505107c..a36b11e 100644 (file)
@@ -19,7 +19,6 @@
 #include       "Lpars.h"
 #include       "align.h"
 #include       "level.h"
-#include       "assert.h"
 #include       "sizes.h"
 
 /*     Type of previous selector declared with a field width specified,
index 3cce2c6..0074584 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*     S W I T C H - S T A T E M E N T  A D M I N I S T R A T I O N    */
 
+#include       <assert.h>
 #include       "parameters.h"
 #ifndef        LINT
 #include       <em.h>
@@ -18,7 +19,6 @@
 #include       "arith.h"
 #include       "switch.h"
 #include       "code.h"
-#include       "assert.h"
 #include       "expr.h"
 #include       "type.h"
 #include       "sizes.h"
@@ -123,7 +123,7 @@ code_endswitch()
                                size);
                ce = sh->sh_entries;
                for (val = sh->sh_lowerbd; val <= sh->sh_upperbd; val++) {
-                       ASSERT(ce);
+                       assert(ce);
                        if (val == ce->ce_value) {
                                C_rom_ilb(ce->ce_label);
                                ce = ce->next;
@@ -167,7 +167,7 @@ code_case(expr)
        register struct case_entry *ce;
        register struct switch_hdr *sh = switch_stack;
        
-       ASSERT(is_cp_cst(expr));
+       assert(is_cp_cst(expr));
        if (sh == 0) {
                error("case statement not in switch");
                return;
@@ -220,7 +220,7 @@ code_case(expr)
                        }
                }
                else {
-                       ASSERT(c2);
+                       assert(c2);
                        ce->next = (struct case_entry *) 0;
                        c2->next = ce;
                }
index be12453..7383d50 100644 (file)
@@ -89,6 +89,9 @@ cprogram {
                "+tabgen_c"
        ),
        deps = {
+               "./LLlex.h", "./arith.h", "./bits.h", "./class.h",
+               "./file_info.h", "./idf.h", "./input.h",
+               "./parameters.h",
                "+llgen",
                "+macro_h",
                "+replace_h",
index 284b495..c0b10e3 100644 (file)
@@ -5,6 +5,7 @@
 /* $Id$ */
 /*  M A C R O   R E P L A C E M E N T */
 
+#include       <assert.h>
 #include       <stdlib.h>
 #include       <stdio.h>
 #include       <string.h>
@@ -17,7 +18,6 @@
 #include       "arith.h"
 #include       "LLlex.h"
 #include       "class.h"
-#include       "assert.h"
 #include       "replace.h"
 
 extern char *GetIdentifier();
diff --git a/modules/src/assert/BadAssert.c b/modules/src/assert/BadAssert.c
deleted file mode 100644 (file)
index 3584221..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $Id$ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* _BadAssertion: used for debugging purposes. It should give an error message
-       indicated by the parameters, and then give a core dump
-*/
-
-#include <string.h>
-#include <system.h>
-
-static
-wr_num(fd, n)
-       File *fd;
-       int n;
-{
-       char s[2];
-
-       s[1] = '\0';
-       if (n >= 10) {
-               wr_num(fd, n/10);
-       }
-       s[0] = (n % 10) + '0';
-       sys_write(fd, s, 1);
-}
-
-int
-_BadAssertion(file, lineno, assertion)
-       char *file, *assertion;
-       int lineno;
-{
-
-       sys_write(STDERR, file, strlen(file));
-       sys_write(STDERR, ", line ", 7);
-       wr_num(STDERR, lineno);
-       sys_write(STDERR, ": assertion \"", 13);
-       sys_write(STDERR, assertion, strlen(assertion));
-       sys_write(STDERR, "\" failed\n", 9);
-       sys_stop(S_ABORT);
-       return 0;
-}
diff --git a/modules/src/assert/assert.3 b/modules/src/assert/assert.3
deleted file mode 100644 (file)
index 8f5f6ec..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-.TH ASSERT 3 "$Revision$"
-.ad
-.SH NAME
-assert \- program verification
-.SH SYNOPSIS
-.B #include <assert.h>
-.PP
-.B assert(expression)
-.PP
-.B _BadAssertion(fn, lino, ass)
-.br
-char *fn, *ass;
-.br
-unsigned int lino;
-.SH DESCRIPTION
-.PP
-.I Assert
-is a macro that indicates
-.I expression
-is expected to be true at this point in the program.
-It causes a call to 
-.I _BadAssertion
-when 
-.I expression
-is false (0).
-.PP
-The routine
-.I_BadAssertion
-accepts three parameters:
-a filename, a linenumber,
-and a string representing a failed assertion.
-It causes a
-.IR sys_stop (S_ABORT)
-with a diagnostic comment on standard error.
-.PP
-The assertions are disabled by defining the preprocessor constant NDEBUG.
-.SH DIAGNOSTICS
-.IR fn ,
-line
-.IR lino :
-assertion
-.I ass
-failed.
-.br
-.I fn
-is the source file,
-.I lino
-is the source line number,
-and
-.I ass
-is the assertion
-of the
-.I assert
-statement.
-.SH MODULES
-system(3)
-.SH FILES
-.nf
-~em/modules/h/assert.h
-~em/modules/lib/libassert.a
-.fi
diff --git a/modules/src/assert/assert.h b/modules/src/assert/assert.h
deleted file mode 100644 (file)
index 2b610de..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id$ */
-/*      A S S E R T I O N    M A C R O   D E F I N I T I O N           */
-
-/* This 'assert' definition can be used in a ,-expression. */
-
-#ifndef        NDEBUG
-#if __STDC__
-int _BadAssertion(char *, int, char *);
-#define        assert(exp)     ((void)((exp) || _BadAssertion(__FILE__, __LINE__, #exp)))
-#else
-/*     Note: this macro uses parameter substitution inside strings */
-#define        assert(exp)     ((exp) || _BadAssertion(__FILE__, __LINE__, "exp"))
-#endif
-#else
-#if __STDC__
-#define        assert(exp)     ((void)0)
-#else
-#define        assert(exp)     (0)
-#endif
-#endif /* NDEBUG */
diff --git a/modules/src/assert/build.lua b/modules/src/assert/build.lua
deleted file mode 100644 (file)
index bd1230b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-clibrary {
-       name = "lib",
-       srcs = { "./*.c" },
-       hdrs = { "./assert.h" },
-}
-
-
diff --git a/util/led/assert.h b/util/led/assert.h
deleted file mode 100644 (file)
index 3aa7b87..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id$ */
-
-#ifndef lint
-#ifdef NASSERT
-
-#define assert(ex)
-
-#else /* NASSERT */
-
-#define assert(ex) \
-{if (!(ex)) fatal("Assertion failed: file %s, line %d", __FILE__, __LINE__);}
-
-#endif /* NASSERT */
-#else /* lint */
-
-#define assert(ex)
-
-#endif /* lint */
index ed84a79..58b4be5 100644 (file)
@@ -2,6 +2,8 @@ cprogram {
     name = "led",
     srcs = { "./*.c" },
     deps = {
+        "./const.h", "./debug.h", "./defs.h", "./mach.h",
+        "./memory.h", "./orig.h", "./scan.h",
         "modules/src/string+lib",
         "modules/src/object+lib",
         "h+emheaders",
index c571582..0c7f020 100644 (file)
@@ -21,6 +21,7 @@ static char rcsid[] = "$Id$";
  * (70000 - 65536).
  */
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -28,7 +29,6 @@ static char rcsid[] = "$Id$";
 #include <unistd.h>
 #include <out.h>
 #include "const.h"
-#include "assert.h"
 #include "debug.h"
 #include "memory.h"
 #include "object.h"
index c06e25c..20beaa5 100644 (file)
@@ -10,6 +10,7 @@ static char rcsid[] = "$Id$";
  * If everything is kept in core, we must save some things for the second pass.
  */
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -18,7 +19,6 @@ static char rcsid[] = "$Id$";
 #include "arch.h"
 #include "out.h"
 #include "const.h"
-#include "assert.h"
 #include "memory.h"
 
 extern bool    incore;
index 610149b..01191f3 100644 (file)
@@ -6,6 +6,7 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -22,7 +23,6 @@ static char rcsid[] = "$Id$";
 #include "ranlib.h"
 #include "object.h"
 #include "const.h"
-#include "assert.h"
 #include "memory.h"
 #include "scan.h"
 #include "debug.h"
index b916949..910323e 100644 (file)
@@ -6,6 +6,7 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -13,7 +14,6 @@ static char rcsid[] = "$Id$";
 #include <string.h>
 #include "out.h"
 #include "const.h"
-#include "assert.h"
 #include "memory.h"
 
 extern struct outhead  outhead;
diff --git a/util/ncgg/assert.h b/util/ncgg/assert.h
deleted file mode 100644 (file)
index 5af4080..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id$ */
-
-#ifndef NDEBUG
-#define assert(x) if (!(x)) badassertion("x",__FILE__,__LINE__)
-#else
-#define assert(x)      /* nothing */
-#endif
index b82f3f3..20846f0 100644 (file)
@@ -32,6 +32,10 @@ cprogram {
                "+keywords"
        ),
        deps = {
+               "./cost.h", "./expr.h", "./extern.h", "./instruct.h",
+               "./iocc.h", "./lookup.h", "./param.h", "./property.h",
+               "./pseudo.h", "./reg.h", "./regvar.h", "./set.h",
+               "./token.h", "./varinfo.h",
                "+cggparser", -- for .h file
                "+cgglexer", -- for .h file
                "h+emheaders",
index d6334d5..85148cd 100644 (file)
@@ -6,7 +6,7 @@
 static char rcsid[]= "$Id$";
 #endif
 
-#include "assert.h"
+#include <assert.h>
 #include "param.h"
 #include "set.h"
 #include "property.h"
index 5d083d5..6eaf597 100644 (file)
@@ -60,15 +60,6 @@ void error(const char* s, ...)
        va_end(ap);
 }
 
-#ifndef NDEBUG
-badassertion(string,file,line) char *string,*file; {
-
-       fprintf(stderr,"\"%s\", line %d: Assertion failed \"%s\"\n",
-               file,line,string);
-       goodbye();
-}
-#endif
-
 tabovf(string) char *string; {
 
        fatal("%s overflow",string);
index 788f0fd..b57e79b 100644 (file)
@@ -6,9 +6,9 @@
 static char rcsid[]= "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "assert.h"
 #include "param.h"
 #include "set.h"
 #include "reg.h"
index f8a5364..f670b24 100644 (file)
@@ -6,7 +6,7 @@
 static char rcsid[]= "$Id$";
 #endif
 
-#include "assert.h"
+#include <assert.h>
 #include "param.h"
 #include "set.h"
 #include "extern.h"
index a6f4506..d45f0fa 100644 (file)
@@ -6,9 +6,9 @@
 static char rcsid[]= "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "assert.h"
 #include "param.h"
 #include "set.h"
 #include "expr.h"
index ab31bae..2b692ce 100644 (file)
@@ -6,7 +6,7 @@
 static char rcsid[]= "$Id$";
 #endif
 
-#include "assert.h"
+#include <assert.h>
 #include "param.h"
 #include "lookup.h"
 #include "extern.h"
index 9d2f2b8..02e3162 100644 (file)
@@ -20,9 +20,9 @@ char  *cd_file=       "code";
 static char rcsid[]= "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <ctype.h>
-#include "assert.h"
 #include "varinfo.h"
 #include "param.h"
 #include "reg.h"
index af154f2..cc6dc66 100644 (file)
@@ -2,12 +2,12 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include "alloc.h"
 #include "line.h"
 #include "lookup.h"
diff --git a/util/opt/assert.h b/util/opt/assert.h
deleted file mode 100644 (file)
index 366ef7b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Id$ */
-
-#ifndef NDEBUG
-#define assert(x) if(!(x)) badassertion(__FILE__,__LINE__)
-#else
-#define assert(x)      /* nothing */
-#endif
index c7b1e4f..83304ce 100644 (file)
@@ -2,10 +2,10 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include "line.h"
 #include "lookup.h"
 #include "alloc.h"
index 2a7edf0..cb86b3f 100644 (file)
@@ -10,18 +10,24 @@ flex {
        srcs = { "./scan.l" }
 }
 
+local headers = {
+       "./alloc.h", "./ext.h", "./line.h", "./lookup.h", "./optim.h",
+       "./param.h", "./pattern.h", "./pop_push.h", "./proinf.h",
+       "./tes.h", "./types.h",
+}
+
 cprogram {
        name = "mktab",
        srcs = {
                matching(filenamesof("+yacc"), "%.c$"),
                matching(filenamesof("+flex"), "%.c$"),
        },
-       deps = {
-               "./*.h",
+       deps = concat(
+               headers,
                "+flex",
                "+yacc",
-               "modules/src/em_data+lib",
-       }
+               "modules/src/em_data+lib"
+       )
 }
 
 normalrule {
@@ -57,15 +63,15 @@ local function variant(name, cflags)
                        "+pop_push_c",
                        "./*.c",
                },
-               deps = {
-                       "./*.h",
+               deps = concat(
+                       headers,
                        "h+emheaders",
                        "modules/src/alloc+lib",
                        "modules/src/print+lib",
                        "modules/src/string+lib",
                        "modules/src/system+lib",
-                       "modules/src/em_data+lib",
-               },
+                       "modules/src/em_data+lib"
+               ),
                vars = {
                        ["+cflags"] = cflags
                }
index f09feeb..95564da 100644 (file)
@@ -2,10 +2,10 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include "param.h"
 #include "types.h"
-#include "assert.h"
 #include <em_pseu.h>
 #include <em_spec.h>
 #include <em_mes.h>
index ccce6a9..9ad466a 100644 (file)
@@ -2,10 +2,10 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include "line.h"
 #include "lookup.h"
 #include "proinf.h"
index bd12270..c1ab7d2 100644 (file)
@@ -2,10 +2,10 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include <em_spec.h>
 #include <em_pseu.h>
 #include "alloc.h"
index 4bceef0..50a8a66 100644 (file)
@@ -2,10 +2,10 @@
 static char rcsid[] = "$Id$";
 #endif
 
+#include <assert.h>
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include <em_spec.h>
 #include <em_pseu.h>
 #include <em_mnem.h>
index 6066c9f..c00dcd1 100644 (file)
@@ -2,7 +2,7 @@
 static char rcsid[] = "$Id$";
 #endif
 
-#include "assert.h"
+#include <assert.h>
 #include "param.h"
 #include "types.h"
 #include "line.h"
index b3d4efd..028bf84 100644 (file)
@@ -7,12 +7,12 @@ static char rcsid[] = "$Id$";
  * Author: Hans van Eck. 
  */
 
+#include <assert.h>
 #include <stdio.h>
 #include <em_spec.h>
 #include <em_mnem.h>
 #include <em_pseu.h>
 #include "param.h"
-#include "assert.h"
 #include "types.h"
 #include "tes.h"
 #include "alloc.h"
index 9cc650c..b387965 100644 (file)
@@ -7,7 +7,6 @@ static char rcsid[] = "$Id$";
 #include "param.h"
 #include "types.h"
 #include "tes.h"
-#include "assert.h"
 #include "lookup.h"
 #include "proinf.h"
 #include "optim.h"
@@ -36,14 +35,6 @@ error(s,a) char *s,*a; {
        exit(-1);
 }
 
-#ifndef NDEBUG
-badassertion(file,line) char *file; unsigned line; {
-
-       fprintf(stderr,"assertion failed file %s, line %u\n",file,line);
-       error("assertion");
-}
-#endif
-
 #ifdef DIAGOPT
 optim(n) {