new flag -A enables it during mkbuiltin.
avoids mysterious errors in programs
that refer to any accidentally.
R=ken
OCL=30763
CL=30763
#include <ar.h>
extern int yychar;
+Sym *anysym;
#define DBG if(!debug['x']);else print
enum
usage:
print("flags:\n");
+ // -A is allow use of "any" type, for bootstrapping
print(" -I DIR search for packages in DIR\n");
print(" -d print declarations\n");
print(" -e no limit on number of errors printed\n");
{
linehist(nil, 0, 0);
+ if(!debug['A'])
+ anysym->def = nil;
+
if(curio.bin != nil) {
Bterm(curio.bin);
curio.bin = nil;
lineno++; // if sys.6 is included on line 1,
linehist(file, 0, 0); // the debugger gets confused
+ if(!debug['A'])
+ anysym->def = typenod(types[TANY]);
+
pushedio = curio;
curio.bin = nil;
curio.peekc = 0;
types[etype] = t;
}
s->def = typenod(t);
+ if(etype == TANY) {
+ anysym = s;
+ if(!debug['A'])
+ s->def = nil;
+ }
continue;
}
rm -f _builtin.c
for i in sys unsafe
do
- $GC $i.go
+ $GC -A $i.go
./mkbuiltin1 $i >>_builtin.c
done