diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-08-02 21:34:40 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:47 +0200 |
commit | 660429af0232d4afcb3e03fb0437053dd6e16286 (patch) | |
tree | ab173f1b824dda797d7633c4c57cde91941c908c /bcc | |
parent | e6248da18100235ae33468d058e5b71fcefeff3b (diff) | |
download | dev86-660429af0232d4afcb3e03fb0437053dd6e16286.tar.gz |
Import Dev86src-0.16.7.tar.gzv0.16.7
Diffstat (limited to 'bcc')
-rw-r--r-- | bcc/bcc.c | 16 | ||||
-rw-r--r-- | bcc/declare.c | 9 | ||||
-rw-r--r-- | bcc/output.c | 2 | ||||
-rw-r--r-- | bcc/patch.file | 157 | ||||
-rw-r--r-- | bcc/q | 112 |
5 files changed, 22 insertions, 274 deletions
@@ -220,6 +220,7 @@ char ** argv; fprintf(stderr, "%s:\n", next_file->file); /* Assembler that's not to be optimised. */ + if (do_preproc && next_file->filetype == 'x') run_aspreproc(next_file); if (do_preproc && next_file->filetype == 'S') run_aspreproc(next_file); if (do_as && next_file->filetype == 's') run_as(next_file); @@ -727,8 +728,7 @@ char ** argv; case 'a': if(strcmp(argv[ar], "-ansi") == 0) { do_unproto = 1; - opt_e = 1; -#if 1 +#if 0 /* NOTE I'm setting this to zero, this isn't a _real_ Ansi cpp. */ prepend_option("-D__STDC__=0", 'p'); #else @@ -815,7 +815,6 @@ char ** argv; case 'E': control_count++; do_compile = do_link = do_as = 0; - opt_e = 1; break; case 'S': control_count++; @@ -874,6 +873,9 @@ char ** argv; if (exe_count && file_count != 1 && !do_link) fatal("only one input file for each non-linked output"); + opt_e = !opt_e; + if (do_unproto || !do_compile) opt_e = 1; + add_prefix(getenv("BCC_EXEC_PREFIX")); #ifdef MC6809 @@ -898,12 +900,18 @@ char ** argv; prepend_option("-D__ELKS__", 'p'); append_option("-c", 'p'); append_option("-f", 'p'); + if (opt_e) { + append_option("-c", 'c'); + append_option("-f", 'c'); + } libc="-lc_f"; break; case 'c': /* Caller saves Elks */ prepend_option("-D__unix__", 'p'); prepend_option("-D__ELKS__", 'p'); append_option("-c", 'p'); + if (opt_e) + append_option("-c", 'c'); libc="-lc"; break; case 's': /* Standalone 8086 */ @@ -947,7 +955,7 @@ char ** argv; append_option("/lib/crt0.o", 'l'); break; default: - fatal("Unknown model specifier for -M"); + fatal("Unknown model specifier for -M valid are: n,f,c,s,d,l,g,8,9,0"); } if (do_optim) diff --git a/bcc/declare.c b/bcc/declare.c index f61887f..3dfb26b 100644 --- a/bcc/declare.c +++ b/bcc/declare.c @@ -461,6 +461,15 @@ PRIVATE bool_pt declspec() && (gsymptr->type == stype || gsymptr->type == ltype)) ntype = 0; + /* Allow long double and long float */ + if (gvartype == ltype + && (gsymptr->type == fltype || gsymptr->type == dtype)) + { + gvartype = dtype; + nextsym(); + break; + } + /* allow int short and int long, blech */ if (gsymptr->type == itype && (gvartype == stype || gvartype == ltype)) diff --git a/bcc/output.c b/bcc/output.c index e5db292..b82f968 100644 --- a/bcc/output.c +++ b/bcc/output.c @@ -40,7 +40,7 @@ FORWARD void outvaldigs P((uvalue_t num)); PUBLIC void bugerror(message) char *message; { - error2error("compiler bug - ", message); + error2error("compiler bug? - ", message); } PUBLIC void closeout() diff --git a/bcc/patch.file b/bcc/patch.file deleted file mode 100644 index 20a3174..0000000 --- a/bcc/patch.file +++ /dev/null @@ -1,157 +0,0 @@ -diff -u5 -r bcc~/declare.c bcc/declare.c ---- bcc~/declare.c Fri Dec 17 17:51:13 1999 -+++ bcc/declare.c Thu Jun 6 13:27:00 2002 -@@ -410,16 +410,17 @@ - } - - PRIVATE bool_pt declspec() - { - unsigned nsc; -+ unsigned nsigned; - unsigned ntype; - unsigned nunsigned; - - gvarsc = NULLDECL; - gvartype = itype; -- nunsigned = ntype = nsc = 0; -+ nsigned = nunsigned = ntype = nsc = 0; - while (TRUE) - { - switch (sym) - { - case AUTODECL: -@@ -482,29 +483,37 @@ - goto break2; - ++ntype; - gvartype = gsymptr->type; - nextsym(); - break; -+ case SIGNDECL: -+ ++nsigned; -+ nextsym(); -+ break; - case UNSIGNDECL: - ++nunsigned; - nextsym(); - break; - default: - goto break2; - } - } -+ - break2: -+ if (nsigned > 0) -+ { -+ if (ntype++ == 0) -+ gvartype = itype; -+ else -+ gvartype = tosigned(gvartype); -+ } - if (nunsigned > 0) - { -- if (ntype == 0) -- { -+ if (ntype++ == 0) - gvartype = uitype; -- ntype = 1; -- } -- gvartype = tounsigned(gvartype); -- if (nunsigned > 1) -- ntype = 2; -+ else -+ gvartype = tounsigned(gvartype); - } - if (nsc > 0) - { - if (ntype == 0) - ntype = 1; -diff -u5 -r bcc~/proto.h bcc/proto.h ---- bcc~/proto.h Sun Jan 11 12:18:36 1998 -+++ bcc/proto.h Thu Jun 6 00:46:24 2002 -@@ -360,8 +360,8 @@ - void outntypechar P((struct typestruct *type)); - struct typestruct *pointype P((struct typestruct *type)); - struct typestruct *prefix P((constr_pt constructor, uoffset_T size, - struct typestruct *type)); - struct typestruct *promote P((struct typestruct *type)); -+struct typestruct *tosigned P((struct typestruct *type)); - struct typestruct *tounsigned P((struct typestruct *type)); - void typeinit P((void)); -- -diff -u5 -r bcc~/scan.h bcc/scan.h ---- bcc~/scan.h Sat Jul 24 14:27:42 1999 -+++ bcc/scan.h Thu Jun 6 00:32:20 2002 -@@ -134,10 +134,11 @@ - - #define LASTOP PTRSUBOP - - ENUMDECL, - NULLDECL, -+ SIGNDECL, - STRUCTDECL, - TYPEDECL, - TYPEDEFNAME, - UNIONDECL, - UNSIGNDECL, -diff -u5 -r bcc~/table.c bcc/table.c ---- bcc~/table.c Sun Sep 28 09:57:30 1997 -+++ bcc/table.c Thu Jun 6 00:29:36 2002 -@@ -28,11 +28,11 @@ - #define MAXEXPR 125 - #else - #define MAXEXPR 500 - #endif - #define MAXLOCAL 100 --#define NKEYWORDS 35 -+#define NKEYWORDS 36 - #ifdef NOFLOAT - #define NSCALTYPES 10 - #else - #define NSCALTYPES 12 - #endif -@@ -88,11 +88,12 @@ - PRIVATE struct keywordstruct keywords[NKEYWORDS] = - { - { "enum", ENUMDECL, }, - { "struct", STRUCTDECL, }, - { "union", UNIONDECL, }, - { "unsigned", UNSIGNDECL, }, -+ { "signed", SIGNDECL, }, - - { "auto", AUTODECL, }, - { "extern", EXTERNDECL, }, - { "register", REGDECL, }, - { "static", STATICDECL, }, -diff -u5 -r bcc~/type.c bcc/type.c ---- bcc~/type.c Sun Jan 11 12:18:37 1998 -+++ bcc/type.c Thu Jun 6 00:49:06 2002 -@@ -155,10 +155,29 @@ - if (type->constructor & FUNCTION) - return pointype(type); - return type; - } - -+PUBLIC struct typestruct *tosigned(type) -+struct typestruct *type; -+{ -+ switch (type->scalar & ~(UNSIGNED | DLONG)) -+ { -+ case CHAR: -+ return sctype; -+ case SHORT: -+ return stype; -+ case INT: -+ return itype; -+ case LONG: -+ return ltype; -+ default: -+ error("signed only applies to integral types"); -+ return type; -+ } -+} -+ - PUBLIC struct typestruct *tounsigned(type) - struct typestruct *type; - { - switch (type->scalar & ~(UNSIGNED | DLONG)) - { @@ -1,112 +0,0 @@ -diff -u5 -r bcc~/declare.c bcc/declare.c ---- bcc~/declare.c Fri Dec 17 17:51:13 1999 -+++ bcc/declare.c Thu Jun 6 13:27:00 2002 -@@ -410,16 +410,17 @@ - } - - PRIVATE bool_pt declspec() - { - unsigned nsc; -+ unsigned nsigned; - unsigned ntype; - unsigned nunsigned; - - gvarsc = NULLDECL; - gvartype = itype; -- nunsigned = ntype = nsc = 0; -+ nsigned = nunsigned = ntype = nsc = 0; - while (TRUE) - { - switch (sym) - { - case AUTODECL: -diff -u5 -r bcc~/proto.h bcc/proto.h ---- bcc~/proto.h Sun Jan 11 12:18:36 1998 -+++ bcc/proto.h Thu Jun 6 00:46:24 2002 -@@ -360,8 +360,8 @@ - void outntypechar P((struct typestruct *type)); - struct typestruct *pointype P((struct typestruct *type)); - struct typestruct *prefix P((constr_pt constructor, uoffset_T size, - struct typestruct *type)); - struct typestruct *promote P((struct typestruct *type)); -+struct typestruct *tosigned P((struct typestruct *type)); - struct typestruct *tounsigned P((struct typestruct *type)); - void typeinit P((void)); -- -diff -u5 -r bcc~/scan.h bcc/scan.h ---- bcc~/scan.h Sat Jul 24 14:27:42 1999 -+++ bcc/scan.h Thu Jun 6 00:32:20 2002 -@@ -134,10 +134,11 @@ - - #define LASTOP PTRSUBOP - - ENUMDECL, - NULLDECL, -+ SIGNDECL, - STRUCTDECL, - TYPEDECL, - TYPEDEFNAME, - UNIONDECL, - UNSIGNDECL, -diff -u5 -r bcc~/table.c bcc/table.c ---- bcc~/table.c Sun Sep 28 09:57:30 1997 -+++ bcc/table.c Thu Jun 6 00:29:36 2002 -@@ -28,11 +28,11 @@ - #define MAXEXPR 125 - #else - #define MAXEXPR 500 - #endif - #define MAXLOCAL 100 --#define NKEYWORDS 35 -+#define NKEYWORDS 36 - #ifdef NOFLOAT - #define NSCALTYPES 10 - #else - #define NSCALTYPES 12 - #endif -@@ -88,11 +88,12 @@ - PRIVATE struct keywordstruct keywords[NKEYWORDS] = - { - { "enum", ENUMDECL, }, - { "struct", STRUCTDECL, }, - { "union", UNIONDECL, }, - { "unsigned", UNSIGNDECL, }, -+ { "signed", SIGNDECL, }, - - { "auto", AUTODECL, }, - { "extern", EXTERNDECL, }, - { "register", REGDECL, }, - { "static", STATICDECL, }, -diff -u5 -r bcc~/type.c bcc/type.c ---- bcc~/type.c Sun Jan 11 12:18:37 1998 -+++ bcc/type.c Thu Jun 6 00:49:06 2002 -@@ -155,10 +155,29 @@ - if (type->constructor & FUNCTION) - return pointype(type); - return type; - } - -+PUBLIC struct typestruct *tosigned(type) -+struct typestruct *type; -+{ -+ switch (type->scalar & ~(UNSIGNED | DLONG)) -+ { -+ case CHAR: -+ return sctype; -+ case SHORT: -+ return stype; -+ case INT: -+ return itype; -+ case LONG: -+ return ltype; -+ default: -+ error("signed only applies to integral types"); -+ return type; -+ } -+} -+ - PUBLIC struct typestruct *tounsigned(type) - struct typestruct *type; - { - switch (type->scalar & ~(UNSIGNED | DLONG)) - { |