home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-11 | 34.5 KB | 1,238 lines |
- *** docs/BUGS.o Tue Dec 8 00:02:47 1992
- --- docs/BUGS Tue Dec 8 00:02:31 1992
- ***************
- *** 1,5 ****
-
- ! c68/c386 Version 4.1
- ~~~~~~~~~~~~~~~~~~~~
-
- The following problems are known to be outstanding in c68/c386 at this
- --- 1,5 ----
-
- ! c68/c386 Version 4.2
- ~~~~~~~~~~~~~~~~~~~~
-
- The following problems are known to be outstanding in c68/c386 at this
- ***************
- *** 21,26 ****
- --- 21,32 ----
-
- N.B. This is not a problem if the pre-processor removes comments.
-
- + 4. An unterninated comment at the end of the file can cause the compiler
- + to loop. This will only be a problem if comments are not removed
- + at the pre-processor stage.
- +
- + 5. No code for handling:
- + i %= c; where i in an int and c is a char
-
- c386
- ~~~~
- *** docs/CHANGELOG.o Tue Dec 8 00:02:53 1992
- --- docs/CHANGELOG Mon Dec 7 23:44:14 1992
- ***************
- *** 1,9 ****
- --- 1,141 ----
- The following is a log (in reverse date order) of the changes made to
- c68/c386 since Release 4.0.
-
- + Planned Changes
- +
- + djw Change 68K IEEE support routines to correctly raise a
- + floating point exception signal when an error occurs
- + with errno set accordingly. (As suggested by Michael
- + Mueller)
- +
- + ---------------------------------------------------------------------------
- + 09 Dec 92 kdw Packaged for release to usenet as release 4.2
- +
- + 06 Dec 92 djw Corrected problem with c68 IEEE version support routines
- + because routines handling op= construct for floating point
- + were not returning address of result as compiler expected.
- +
- + 05 Dec 92 kdw Corrected problem with double constants being incorrectly
- + assigned to float tree constants.
- +
- + kdw Corrected problem in c68 IEEE version with constructs of the
- + form 'op = ' when flaoting point numbers involved. Incorrect
- + code was being generated.
- +
- + 27 Nov 92 djw Allowed for initialisation of character arrays by a
- + construct of the form: char x[6]="123456";
- + Previously this would have been reported as an error
- + due to the initialiser being too long.
- +
- + 26 Nov 92 djw Incorporated changes provided by Vincent Broman to allow
- + bootstrapping c386 using bcc.
- +
- + djw Incorporated changes based on those supplied by Peter
- + Holzer for the handling of U and L suffixes on numbers.
- +
- + djw Made changes based on those supplied by (?)
- + to allow c386 to be bootstrapped using bcc.
- +
- + 22 Nov 92 kdw Added support for expression of the form p++->n (as
- + ANSI does) unless -trad flag set.
- +
- + kdw Added new warning for when arrays initialisation
- + expression does not set all fields of an array.
- +
- + kdw Allowed & operator to be used on array names - but
- + warning is generated.
- +
- + kdw Reworked code to do with parsing of qualifier keywords
- + such as signed, unsigned, const and volatile.
- +
- + 13 Nov 92 kdw Fixed problem in branch optimiser code to handle
- + instruction branching to itself. The previous fix for
- + this had proved to be incomplete.
- +
- + 26 Oct 92 kdw Fixed problem with signed keyowrd not being recognised
- + properly.
- +
- + 25 Oct 92 djw The space for the buffer used to hold strings is now
- + allocated dynamically as required removing the upper
- + limit on total string size.
- +
- + djw Changed the generation of string literals so that they
- + are put into the data section if the 'trad' flag is set
- + (when they are potentially writeable), but into the text
- + section otherwise (when they are read only.
- +
- + 24 Oct 92 kdw Fixed bug when you to try to return a void value in
- + an function which is not of type void.
- +
- + djw Added TRACE option to configuration file, and run-time
- + switch to activate trace mode.
- +
- + kdw Overhauled routine that does the 'cast' operation to pick
- + up a number of cast operations that should generate either
- + error or warning messages.
- +
- + djw Fixed bug with using the U qualifier on a 0 constant.
- + (reported by David Gillam)
- +
- + djw Fixed bug with using both the U and L qualifiers on the
- + same constant.
- + (reported by Michael Mueller)
- +
- + 20 Oct 92 kdw Added code that is being used as a basis for work on trying
- + to develop source level debugger/trace capability. This is
- + still experimental, but has been added to the main source to
- + avoid having diverging source trees. It is conditionally
- + included so taht it is not activated unless so desired.
- +
- + 13 Oct 92 kdw Fixed problem with initialising 'int' variables with
- + a floating point value cast to int. Also now will
- + recognise casts of floating point constants to int
- + at compile stage rather than generating run-time code
- + to do this.
- +
- + 11 Oct 92 kdw The test phase of for and while loops moved to physically
- + occur after the code inside the loop, and a jump to it
- + inserted at the head. This has the effect of reducing
- + the number of branch instructions executed for going n
- + times around the loop to n+1 rather than 2n.
- +
- + 10 Oct 92 kdw Patch (supplied by Michael Mueller) to getsym.c to reduce
- + chance of rounding errors when calaculating floating
- + point constants.
- +
- + 08 Oct 92 kdw Fixed bug in branch optimisers whereby an instruction
- + that branches to itself would cause the compiler to loop.
- + Such code occurs in the init.c module of Minix 1.6.16.
- + (reported by malte)
- +
- + 06 Oct 92 kdw Generate .extern instead of .define in ACK 68K assembler
- + files. It is not clear that this is necessary, but that
- + is the way ACK does it.
- + (reported by Mark Newton)
- +
- + kdw Case jump tables now generated in store and output at the
- + end of a generating the code for a function (Previously
- + they were output before generating the code). This
- + allows the peephole optimisers access to jump table
- + labels.
- +
- + kdw Delete redundant labels. Allows better optimisation,
- + particularily with reference to elimination of dead
- + code.
- +
- + djw Fixed bug in msgout.c when __STDC__ defined, and also
- + HAS_STDARG defined.
- +
- + 05 Oct 92 kdw Implement user configuration of the types of 'sizeof'
- + and pointer difference.
- +
- ---------------------------------------------------------------------
- 04 Oct 92 Packaged for release to usenet as Version 4.1
-
- + 03 Oct 92 kdw Added configuration option to allow users to specify
- + whether varargs.h or stdarg.h is to be used - the
- + msgout.c module changed to reflect this.
- +
- 02 Oct 92 kdw Added error message for void expressions passed as
- parameters to functions (reported by Mark Newton)
-
- *** docs/install.doc.o Tue Dec 8 00:03:22 1992
- --- docs/install.doc Mon Dec 7 15:21:00 1992
- ***************
- *** 33,38 ****
- --- 33,44 ----
- install the supplied binary in /usr/lib/c68. The binary supplied
- is actually built using the IEEE floating point support option.
-
- + A version of the c386 binary is not supplied. You can boot the c386
- + compiler in this case using either the GNU gcc compiler, or you can
- + use bcc. Note that in this last case you need to make sure that
- + you have a recent version that supports floating point if you wish
- + to build a version of c386 that supports floating point.
- +
- 4. If you do not have a vesion of cc that supports c68, then a simple
- version is supplied as a shell script called cc68. Install
- this on your normal search path.
- ***************
- *** 51,56 ****
- --- 57,71 ----
- 7. Install the compiler on your search path - you are now ready to go!
-
-
- + Using standard MINIX stdio with c68/c386
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- +
- + The standard MINIX distribution is missing the library routine
- + vfprintf() which is required to build c68/c386. A version of this
- + routine that is useable with the standard MINIX stdio routines is
- + supplied with the c68/c386 source.
- +
- +
- Using ESTDIO with c68
- ~~~~~~~~~~~~~~~~~~~~~
-
- *** libieee/Makefile.o Mon Dec 7 23:34:53 1992
- --- libieee/Makefile Mon Dec 7 23:34:54 1992
- ***************
- *** 14,19 ****
- --- 14,22 ----
-
- all : ${OBJ}
-
- + .s.o :
- + ${AS} $<
- +
- install: ${OBJ}
- ar crv ${LIB}/libc.a ${OBJ}
-
- *** libieee/_asf4.s.o Mon Dec 7 23:35:07 1992
- --- libieee/_asf4.s Mon Dec 7 23:32:54 1992
- ***************
- *** 5,17 ****
- !
- ! #1 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- !-----------------------------------------------------------------------------
-
- .sect .text
-
- - V = 4 + 3*4 ! stack offset of v
- - U = V + 4 ! stack offset of u
- -
- #ifndef NOC68
- .define .assfadd
- .define .assfsub
- --- 5,15 ----
- !
- ! #1 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- + ! #2 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- .sect .text
-
- #ifndef NOC68
- .define .assfadd
- .define .assfsub
- ***************
- *** 32,45 ****
- .assfadd:
- move.l #0,d0
- 1:
- pea tidyc68a ! set exit routine address
- movem.l d3/d4/d6,-(sp) ! save registers
-
- - move.l V+8(sp),a0 ! address of v
- move.l (a0),d4 ! load v
- eor.l d0,d4 ! reverse sign of v if necessary
-
- - move.l V+4(sp),a1 ! address of u
- move.l (a1),d6 ! load u
- bra shared
-
- --- 30,43 ----
- .assfadd:
- move.l #0,d0
- 1:
- + move.l 8(sp),a0 ! address of v
- + move.l 4(sp),a1 ! address of u
- pea tidyc68a ! set exit routine address
- movem.l d3/d4/d6,-(sp) ! save registers
-
- move.l (a0),d4 ! load v
- eor.l d0,d4 ! reverse sign of v if necessary
-
- move.l (a1),d6 ! load u
- bra shared
-
- ***************
- *** 47,52 ****
- --- 45,51 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of u returned as result
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
-
- *** libieee/_asf8.s.o Mon Dec 7 23:35:14 1992
- --- libieee/_asf8.s Mon Dec 7 23:35:16 1992
- ***************
- *** 6,11 ****
- --- 6,12 ----
- ! #2 replaced shifts by swap if possible for speed increase -kub-, 01/90
- ! #3 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- + ! #4 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- .sect .text
- ***************
- *** 38,50 ****
- .asdfadd:
- move.l #0,d0
- 1:
- ! pea tidyc68a ! set exit routine address
- ! movem.l d3-d7,-(sp) ! save registers
- ! move.l V+8(sp),a0 ! address of v
- ! movem.l (a0),d4-d5 ! load v
- ! eor.l d0,d4 ! reverse sign of v if needed
- !
- ! move.l V+4(sp),a1 ! address of u
- movem.l (a1),d6-d7 ! load u
-
- bra shared
- --- 39,50 ----
- .asdfadd:
- move.l #0,d0
- 1:
- ! move.l 8(sp),a0 ! address of v
- ! move.l 4(sp),a1 ! address of u
- ! pea tidyc68a ! set exit routine address
- ! movem.l d3-d7,-(sp) ! save registers
- ! movem.l (a0),d4-d5 ! load v
- ! eor.l d0,d4 ! reverse sign of v if needed
- movem.l (a1),d6-d7 ! load u
-
- bra shared
- ***************
- *** 53,58 ****
- --- 53,59 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of u needs to be returned
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
- #endif /* NOC68 */
- *** libieee/_cif4.s.o Mon Dec 7 23:35:51 1992
- --- libieee/_cif4.s Mon Dec 7 23:35:53 1992
- ***************
- *** 64,70 ****
- clr.w d1 ! extend it to long value
- move.w #BIAS4+16-8,d0 ! radix point after 16 bits
- bra 0f
- ! #endif NOACK
-
- !-----------------------------------------------
- ! The code from here is common to the
- --- 64,70 ----
- clr.w d1 ! extend it to long value
- move.w #BIAS4+16-8,d0 ! radix point after 16 bits
- bra 0f
- ! #endif /* NOACK */
-
- !-----------------------------------------------
- ! The code from here is common to the
- *** libieee/_dvf4.s.o Mon Dec 7 23:36:31 1992
- --- libieee/_dvf4.s Mon Dec 7 23:36:33 1992
- ***************
- *** 14,19 ****
- --- 14,20 ----
- ! Due to speed improvements the code is rather cryptic.
- ! #4 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- + ! #5 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- BIAS4 = 0x7F - 1
- ***************
- *** 48,53 ****
- --- 49,55 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of u returned as result
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
-
- *** libieee/_dvf8.s.o Mon Dec 7 23:36:40 1992
- --- libieee/_dvf8.s Mon Dec 7 23:36:42 1992
- ***************
- *** 14,19 ****
- --- 14,20 ----
- ! Due to speed improvements the code is rather cryptic.
- ! #4 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- + ! #5 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- V = 4 + 5*4 ! offset of multiplicand
- ***************
- *** 53,58 ****
- --- 54,60 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of u returned as a result
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
-
- *** libieee/_mlf4.s.o Mon Dec 7 23:36:55 1992
- --- libieee/_mlf4.s Mon Dec 7 23:36:57 1992
- ***************
- *** 7,12 ****
- --- 7,13 ----
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- ! #2 Corrected problem with corrupting D7. Redid register
- ! useage to slightly increase effeciency. Dave Walker 09/92
- + ! #3 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- BIAS4 = 0x7F - 1
- ***************
- *** 39,44 ****
- --- 40,46 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of v returned as result
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
-
- *** libieee/_mlf8.s.o Mon Dec 7 23:37:05 1992
- --- libieee/_mlf8.s Mon Dec 7 23:37:07 1992
- ***************
- *** 9,14 ****
- --- 9,15 ----
- ! #3 added support for denormalized numbers -kub-, 01/90
- ! #4 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- + ! #5 Changed exit code to put pointer to result in D0 Dave Walker 12/92
- !-----------------------------------------------------------------------------
-
- V = 4 + 5*4 ! offset of multiplicand
- ***************
- *** 46,51 ****
- --- 47,53 ----
-
- tidyc68a:
- move.l (sp)+,a0 ! get return address
- + move.l (sp),d0 ! address of v returned as result
- lea 8(sp),sp ! remove 2 parameters from stack
- jmp (a0) ! ... and return
-
- *** src/Makefile.o Mon Dec 7 13:08:44 1992
- --- src/Makefile Mon Dec 7 13:08:46 1992
- ***************
- *** 3,12 ****
- # N.B. Some modules will generate empty source files
- # according to the DEFINES set in config.h
-
- ! # Select either GCC or c68 or bcc to compile this (not ACK!!)
- ! CC= cc68
- ! CFLAGS= -O -Qwarn=5
- ! LDFLAGS = -s -m250000
-
- HDR = c.h cglbdec.h expr.h gen.h version.h config.h
-
- --- 3,27 ----
- # N.B. Some modules will generate empty source files
- # according to the DEFINES set in config.h
-
- ! #--------------------------------------------------------
- ! # Use the following if compiling with c68
- ! CC= cc68
- ! CFLAGS= -O -Qwarn=5 -DNDEBUG -D__STDC__=1
- ! LDFLAGS= -s -m250000
- ! LIB=
- ! #--------------------------------------------------------
- ! # Use the following if compiling with GNU C
- ! # CC= gcc
- ! # CFLAGS= -O -NDEBUG
- ! # LDFLAGS= -s -m250000
- ! # LIB=
- ! #--------------------------------------------------------
- ! # Use the following if compiling with bcc
- ! # CC= bcc -3
- ! # CFLAGS= -DNDEBUG -DINTEL_32BITS
- ! # LDFLAGS = -i
- ! # LIB=
- ! #--------------------------------------------------------
-
- HDR = c.h cglbdec.h expr.h gen.h version.h config.h
-
- ***************
- *** 14,19 ****
- --- 29,40 ----
- intexpr.c searchkw.c cglbdef.c list.c \
- stmt.c cmain.c genstmt.c memmgt.c msgout.c \
- symbol.c decl.c getsym.c genicode.c outgen.c
- +
- + # The following is only required if your library does not
- + # already contain this routine.
- + # SRCLIB = vfprintf.c
- + # Use this setting if you already have vfprintf
- + SRCLIB =
- #
- SRC68K =config.c68 gen68k.c reg68k.c peep68k.c genffp.c genieee.c \
- out68k_ack.c out68k_cpm.c out68k_gas.c
- ***************
- *** 26,31 ****
- --- 47,58 ----
- stmt.o cmain.o genstmt.o memmgt.o msgout.o \
- symbol.o decl.o getsym.o genicode.o outgen.o
- #
- + # The following is only required if your library does not
- + # already contain this routine.
- + # OBJLIB = vfprintf.o
- + # Use this setting if you already have vfprintf
- + OBJLIB =
- + #
- OBJ68K= gen68k.o reg68k.o peep68k.o genffp.o genieee.o \
- out68k_ack.o out68k_cpm.o out68k_gas.o
- #
- ***************
- *** 39,56 ****
- @echo " make c68"
- @echo " make c386"
-
- ! c68: config_check_c68 $(OBJ) $(OBJ68K) $(OBJ386)
- ! $(CC) $(LDFLAGS) -o c68 $(OBJ) \
- ! $(OBJ68K) \
- ! $(OBJ386)
-
- config_check_c68:
- ./copy-if-change config.c68 config.h
-
- ! c386: config_check_c386 $(OBJ) $(OBJ68K) $(OBJ386)
- ! $(CC) $(LDFLAGS) -o c386 $(OBJ) \
- ! $(OBJ68K) \
- ! $(OBJ386)
-
- config_check_c386:
- ./copy-if-change config.c386 config.h
- --- 66,86 ----
- @echo " make c68"
- @echo " make c386"
-
- ! c68: config_check_c68 $(OBJ) ${OBJLIB} $(OBJ68K) $(OBJ386)
- ! $(CC) $(LDFLAGS) -o c68 $(OBJ) \
- ! $(OBJ68K) \
- ! $(OBJ386) \
- ! ${OBJLIB} ${LIB}
-
- config_check_c68:
- ./copy-if-change config.c68 config.h
-
- ! c386: config_check_c386 $(OBJ) ${OBJLIB} $(OBJ68K) $(OBJ386)
- ! $(CC) $(LDFLAGS) -o c386 $(OBJ) \
- ! $(OBJ68K) \
- ! $(OBJ386) \
- ! ${OBJLIB} ${LIB}
- ! chmem =200000 c386
-
- config_check_c386:
- ./copy-if-change config.c386 config.h
- *** src/c.h.o Mon Dec 7 13:09:03 1992
- --- src/c.h Thu Nov 26 22:04:23 1992
- ***************
- *** 24,30 ****
-
-
- #include <sys/types.h>
- ! #include <sys/times.h>
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- --- 24,32 ----
-
-
- #include <sys/types.h>
- ! #ifdef VERBOSE
- ! #include <sys/times.h>
- ! #endif
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- ***************
- *** 50,56 ****
- kw_register, kw_typedef, kw_static, kw_goto, kw_return,
- kw_sizeof, kw_break, kw_continue, kw_if, kw_else, kw_for,
- kw_do, kw_while, kw_switch, kw_case, kw_default,
- ! uconst, eof
- };
-
- /* storage classes */
- --- 52,58 ----
- kw_register, kw_typedef, kw_static, kw_goto, kw_return,
- kw_sizeof, kw_break, kw_continue, kw_if, kw_else, kw_for,
- kw_do, kw_while, kw_switch, kw_case, kw_default,
- ! uconst, ulconst, eof
- };
-
- /* storage classes */
- ***************
- *** 120,125 ****
- --- 122,134 ----
- int used;
- };
-
- + struct swtab {
- + int tablab;
- + int numlabs;
- + int * labels;
- + struct swtab *next;
- + };
- +
- #define SYM_USED 1
- #define SYM_DEFINED 2
-
- ***************
- *** 127,133 ****
- #define TABLE struct stab
-
- #define MAX_ERROR_COUNT 200
- - #define MAX_STRLEN 1500
- #define MAX_ID_LEN 50
- #define MAX_PARAMS 100
- #define REG_LIST 20
- --- 136,141 ----
- ***************
- *** 282,287 ****
- --- 290,296 ----
- ERR_FIELD,
- ERR_FPCON,
- ERR_IDEXPECT,
- + ERR_ILLCAST,
- ERR_ILLCHAR,
- ERR_ILLCLASS,
- ERR_ILLINIT,
- ***************
- *** 345,355 ****
- --- 354,366 ----
- */
- #define WARN_LEVEL4 WARN_0TYPEDEF
- WARN_0TYPEDEF,
- + WARN_ADDARRAY,
- WARN_ADDFUNC,
- WARN_EMPTY,
- WARN_HIDE,
- WARN_IMPLICIT,
- WARN_IMPLICITFN,
- + WARN_INCOMPLETE,
- WARN_NOTKANDR,
- WARN_NOTUSED,
- /*
- ***************
- *** 386,392 ****
- WARN_FLDTYPE,
- WARN_NOCOPY,
- WARN_PRAGMA,
- - WARN_STRINGCUT,
- /*
- * Messages below this point are output without file/line number details
- */
- --- 397,402 ----
- *** src/cglbdec.h.o Mon Dec 7 13:09:12 1992
- --- src/cglbdec.h Thu Nov 26 22:04:26 1992
- ***************
- *** 29,36 ****
- extern unsigned int nextlabel;
- extern int lastch;
- extern enum e_sym lastst;
- ! #define lastid laststr
- ! extern char laststr[MAX_STRLEN + 1];
- extern int lstrlen;
- extern unsigned long ival;
- #ifndef NOFLOAT
- --- 29,36 ----
- extern unsigned int nextlabel;
- extern int lastch;
- extern enum e_sym lastst;
- ! #define lastid laststr /* same buffer for last string and last id */
- ! extern char *laststr;
- extern int lstrlen;
- extern unsigned long ival;
- #ifndef NOFLOAT
- ***************
- *** 40,45 ****
- --- 40,46 ----
- extern TABLE gsyms, lsyms, labsyms, gtags, ltags;
-
- extern struct slit *strtab;
- + extern struct swtab *swtables;
- extern long lc_auto;
- extern long max_scratch;
- extern long act_scratch;
- ***************
- *** 63,68 ****
- --- 64,72 ----
- #endif
- extern int verbose_option;
- extern int trad_option;
- + #ifdef TRACE
- + extern int trace_option;
- + #endif /* TRACE */
- extern int max_error_count;
-
- extern TYP *ret_type;
- *** src/cglbdef.c.o Mon Dec 7 13:09:19 1992
- --- src/cglbdef.c Mon Dec 7 13:09:21 1992
- ***************
- *** 36,42 ****
- unsigned int nextlabel;
- int lastch = ' ';
- enum e_sym lastst;
- ! char laststr[MAX_STRLEN + 1];
- int lstrlen;
- unsigned long ival;
- #ifndef NOFLOAT
- --- 36,42 ----
- unsigned int nextlabel;
- int lastch = ' ';
- enum e_sym lastst;
- ! char *laststr = NULL;
- int lstrlen;
- unsigned long ival;
- #ifndef NOFLOAT
- ***************
- *** 46,51 ****
- --- 46,52 ----
- TABLE gsyms, gtags, lsyms, labsyms, ltags;
-
- struct slit *strtab;
- + struct swtab *swtables;
- long lc_auto;
- long max_scratch;
- long act_scratch;
- ***************
- *** 79,84 ****
- --- 80,88 ----
- #endif
- int verbose_option = 0;
- int trad_option = 0;
- + #ifdef TRACE
- + int trace_option = 0;
- + #endif
- int max_error_count = MAX_ERROR_COUNT;
-
- #ifdef QDOS
- ***************
- *** 90,96 ****
- long _stackmargin = 1024L;
- void consetup_title();
- void (*_consetup)() = consetup_title;
- ! long (*_writetrans)() = NULL;
- char _version[] = VERSION;
- char _copyright[] = LAST_CHANGE_DATE;
- #endif /* QDOS */
- --- 94,100 ----
- long _stackmargin = 1024L;
- void consetup_title();
- void (*_consetup)() = consetup_title;
- ! long (*_conwrite)() = NULL;
- char _version[] = VERSION;
- char _copyright[] = LAST_CHANGE_DATE;
- #endif /* QDOS */
- ***************
- *** 106,112 ****
- long decl_time = 0, parse_time = 0, opt_time = 0, gen_time = 0, flush_time = 0;
- #endif
-
- ! TYP tp_void = {{0, 0}, 0, 0, -1, bt_void, 0, 1, 0, 0};
- TYP tp_long = {{0, 0}, 0, 0, 4, bt_long, 0, 1, 0, 0};
- TYP tp_ulong = {{0, 0}, 0, 0, 4, bt_ulong, 0, 1, 0, 0};
- TYP tp_char = {{0, 0}, 0, 0, 1, bt_char, 0, 1, 0, 0};
- --- 110,116 ----
- long decl_time = 0, parse_time = 0, opt_time = 0, gen_time = 0, flush_time = 0;
- #endif
-
- ! TYP tp_void = {{0, 0}, 0, 0, UNKNOWN_SIZE, bt_void, 0, 1, 0, 0};
- TYP tp_long = {{0, 0}, 0, 0, 4, bt_long, 0, 1, 0, 0};
- TYP tp_ulong = {{0, 0}, 0, 0, 4, bt_ulong, 0, 1, 0, 0};
- TYP tp_char = {{0, 0}, 0, 0, 1, bt_char, 0, 1, 0, 0};
- *** src/cmain.c.o Mon Dec 7 13:09:29 1992
- --- src/cmain.c Mon Dec 7 13:09:31 1992
- ***************
- *** 63,69 ****
- char *ptr;
-
- for (i = 1; i < _NSIG; ++i)
- ! (void) signal(i, exception);
-
- /* Accept parameters from Environment */
- #ifdef MC680X0
- --- 63,69 ----
- char *ptr;
-
- for (i = 1; i < _NSIG; ++i)
- ! VOIDCAST signal(i, exception);
-
- /* Accept parameters from Environment */
- #ifdef MC680X0
- ***************
- *** 199,204 ****
- --- 199,210 ----
- volatile_found = !trad_option;
- return;
- }
- + #ifdef TRACE
- + if (!strcmp(s, "trace")) {
- + trace_option = value;
- + return;
- + }
- + #endif
- if (!strcmp(s, "v")) {
- verbose_option = 1;
- eprintf ("%s %s (%s)\n",PROGNAME, VERSION, LAST_CHANGE_DATE);
- ***************
- *** 266,275 ****
- closefiles()
- {
- if (list_option)
- ! (void) fclose(list);
- ! #ifdef ICODE
- ! if (icode_option)
- ! (void) fclose(icode);
- #endif
- }
-
- --- 272,281 ----
- closefiles()
- {
- if (list_option)
- ! VOIDCAST fclose(list);
- ! #ifdef ICODE
- ! if (icode_option)
- ! VOIDCAST fclose(icode);
- #endif
- }
-
- *** src/config.c386.o Tue Dec 01 23:26:11 1992
- --- src/config.c386 Wed Dec 09 21:41:51 1992
- ***************
- *** 20,25 ****
- --- 20,26 ----
- /* #define HAS_NLS 1 /* system supports message catalogues */
- #define HAS_STDARG 1 /* system supports stdarg.h */
- /* #define NOFLOAT 1 /* Do not generate floating point support */
- + #define NO_FLOAT_PRINTF /* no FP printf for emitting float constants */
- /* #define NODOUBLE 1 /* Treat 'float' and 'double' as same (MFFP version) */
- /*
- * These options tend not to be changed except when developing
- ***************
- *** 26,31 ****
- --- 27,37 ----
- */
- /* #define VERBOSE 1 /* Generate verbose mode code in compiler */
- /* #define ICODE 1 /* Generate icode analysis code in compiler */
- + /*
- + * This option is still experimental and under development, so it
- + * should not normally be activated.
- + */
- + #define TRACE 1 /* Generate calls for trace/debugger support */
-
- /*
- * MOTOROLA 68000 OPTIONS
- ***************
- *** 50,56 ****
- #define INTEL_386 1 /* This is an Intel 386 compiler */
- #define SEPARATE_I_D 1 /* Separate I and D spaces */
-
- ! #define FUNCS_USE_387 1 /* ... very special option */
-
- /* #define TARGET_GAS /* Assembler Syntax is for GAS/Sun386i */
- /* #define TARGET_SUN /* Assembler Syntax is for Sun386i */
- --- 56,69 ----
- #define INTEL_386 1 /* This is an Intel 386 compiler */
- #define SEPARATE_I_D 1 /* Separate I and D spaces */
-
- ! /*
- ! * if FUNCS_USE_387 is defined, extra library calls are generated if the
- ! * nofpu option is in effect that allows to use code generated by
- ! * this compiler to be linked with functions that return values
- ! * on the 387 stack.
- ! * there is no provision for returns on the ESP stack.
- ! */
- ! #define FUNCS_USE_387 1
-
- /* #define TARGET_GAS /* Assembler Syntax is for GAS/Sun386i */
- /* #define TARGET_SUN /* Assembler Syntax is for Sun386i */
- ***************
- *** 70,75 ****
- --- 83,104 ----
- #define VOIDCAST (void) /* Set to space if 'void' not supported */
-
- /*
- + * Many K&R compiler have assumed that the result of the sizeof operator
- + * is an int. However ANSI assumes that the result is the type size_t.
- + * Ensure that the setting is compatible with the value defined in your
- + * library and header files.
- + */
- + #define TP_SIZE tp_uint /* size_t type; either tp_uint or tp_ulong */
- + /*
- + * Many K&R compilers have assumed that the result of the pointer difference
- + * operation is an int. However ANSI assumes that the result is the type
- + * ptrdiff_t. Ensure that the setting is compatible with the value defined
- + * in your library and header files.
- + * NOTE: This must be a signed value.
- + */
- + #define TP_PTRDIFF tp_int /* ptrdiff_t type; either tp_int or tp_long */
- +
- + /*
- * Do not change anything beyond this point
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
- ***************
- *** 144,156 ****
- #define PROGNAME "c386"
- #define LIST_NAME "c386.list"
- #define ICODE_NAME "c386.icode"
- - /*
- - * if FUNCS_USE_387 is defined, extra library calls are generated if the
- - * nofpu option is in effect that allows to use code generated by
- - * this compiler to be linked with functions that return values
- - * on the 387 stack
- - */
- - #define FUNCS_USE_387
- #endif
-
- #ifndef CPU_DEFINED
- --- 173,178 ----
- *** src/config.c68.o Mon Dec 7 13:09:50 1992
- --- src/config.c68 Thu Nov 26 22:04:13 1992
- ***************
- *** 20,31 ****
- --- 20,37 ----
- /* #define HAS_NLS 1 /* system supports message catalogues */
- #define HAS_STDARG 1 /* system supports stdarg.h */
- /* #define NOFLOAT 1 /* Do not generate floating point support */
- + /* #define NO_FLOAT_PRINTF /* no FP printf for emitting float constants */
- /* #define NODOUBLE 1 /* Treat 'float' and 'double' as same (MFFP version) */
- /*
- * These options tend not to be changed except when developing
- */
- /* #define VERBOSE 1 /* Generate verbose mode code in compiler */
- /* #define ICODE 1 /* Generate icode analysis code in compiler */
- + /*
- + * This option is still experimental and under development, so it
- + * should not normally be activated.
- + */
- + #define TRACE 1 /* Generate calls for trace/debugger support */
-
- /*
- * MOTOROLA 68000 OPTIONS
- ***************
- *** 50,55 ****
- --- 56,68 ----
- /* #define INTEL_386 1 /* This is an Intel 386 compiler */
- /* #define SEPARATE_I_D 1 /* Separate I and D spaces */
-
- + /*
- + * if FUNCS_USE_387 is defined, extra library calls are generated if the
- + * nofpu option is in effect that allows to use code generated by
- + * this compiler to be linked with functions that return values
- + * on the 387 stack.
- + * there is no provision for returns on the ESP stack.
- + */
- /* #define FUNCS_USE_387 1 /* ... very special option */
-
- /* #define TARGET_GAS /* Assembler Syntax is for GAS/Sun386i */
- ***************
- *** 70,75 ****
- --- 83,104 ----
- #define VOIDCAST (void) /* Set to space if 'void' not supported */
-
- /*
- + * Many K&R compiler have assumed that the result of the sizeof operator
- + * is an int. However ANSI assumes that the result is the type size_t.
- + * Ensure that the setting is compatible with the value defined in your
- + * library and header files.
- + */
- + #define TP_SIZE tp_uint /* size_t type; either tp_uint or tp_ulong */
- + /*
- + * Many K&R compilers have assumed that the result of the pointer difference
- + * operation is an int. However ANSI assumes that the result is the type
- + * ptrdiff_t. Ensure that the setting is compatible with the value defined
- + * in your library and header files.
- + * NOTE: This must be a signed value.
- + */
- + #define TP_PTRDIFF tp_int /* ptrdiff_t type; either tp_int or tp_long */
- +
- + /*
- * Do not change anything beyond this point
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
- ***************
- *** 144,156 ****
- #define PROGNAME "c386"
- #define LIST_NAME "c386.list"
- #define ICODE_NAME "c386.icode"
- - /*
- - * if FUNCS_USE_387 is defined, extra library calls are generated if the
- - * nofpu option is in effect that allows to use code generated by
- - * this compiler to be linked with functions that return values
- - * on the 387 stack
- - */
- - #define FUNCS_USE_387
- #endif
-
- #ifndef CPU_DEFINED
- --- 173,178 ----
- *** src/decl.c.o Mon Dec 7 13:09:59 1992
- --- src/decl.c Mon Dec 7 13:10:05 1992
- ***************
- *** 98,129 ****
- return tp;
- }
-
- ! void
- ! decl(table)
- ! TABLE *table;
- ! {
- ! struct sym *sp;
- !
- ! /*
- ! * at top level, 'int' is changed to 'short' or 'long'
- ! */
- !
- /* for now just swallow "const" and "volatile" */
- switch (lastst) {
- case kw_const:
- getsym();
- ! head = tail = &tp_int;
- if (lastst == kw_volatile)
- getsym();
- break;
- case kw_volatile:
- getsym();
- ! head = tail = &tp_int;
- if (lastst == kw_const)
- getsym();
- break;
- }
- !
- switch (lastst) {
- case kw_void:
- head = tail = &tp_void;
- --- 98,134 ----
- return tp;
- }
-
- ! static void
- ! qualifier()
- ! {
- /* for now just swallow "const" and "volatile" */
- switch (lastst) {
- case kw_const:
- getsym();
- ! if (head == NULL)
- ! head = tail = &tp_int;
- if (lastst == kw_volatile)
- getsym();
- break;
- case kw_volatile:
- getsym();
- ! if (head == NULL)
- ! head = tail = &tp_int;
- if (lastst == kw_const)
- getsym();
- break;
- }
- ! }
- !
- ! void
- ! decl()
- ! {
- ! struct sym *sp;
- !
- ! /*
- ! * at top level, 'int' is changed to 'short' or 'long'
- ! */
- ! qualifier();
- switch (lastst) {
- case kw_void:
- head = tail = &tp_void;
- ***************
- *** 135,145 ****
- break;
- case kw_short:
- getsym();
- ! if (lastst == kw_unsigned) {
- ! getsym();
- ! head = tail = &tp_ushort;
- ! } else
- ! head = tail = &tp_short;
- if (lastst == kw_int)
- getsym();
- break;
- --- 140,156 ----
- break;
- case kw_short:
- getsym();
- ! qualifier();
- ! switch (lastst) {
- ! case kw_unsigned:
- ! getsym();
- ! head = tail = &tp_ushort;
- ! break;
- ! case kw_signed:
- ! getsym();
- ! default:
- ! head = tail = &tp_short;
- ! }
- if (lastst == kw_int)
- getsym();
- break;
- ***************
- *** 149,154 ****
- --- 160,166 ----
- break;
- case kw_long:
- getsym();
- + qualifier();
- switch (lastst) {
- case kw_unsigned:
- getsym();
- ***************
- *** 166,171 ****
- --- 178,184 ----
- getsym();
- head = tail = &tp_longdouble;
- break;
- + case kw_signed:
- case kw_int:
- getsym();
- /*FALLTHROUGH*/
- ***************
- *** 176,181 ****
- --- 189,195 ----
- break;
- case kw_unsigned:
- getsym();
- + qualifier();
- switch (lastst) {
- case kw_long:
- getsym();
- ***************
- *** 202,207 ****
- --- 216,222 ----
- break;
- case kw_signed:
- getsym();
- + qualifier();
- switch (lastst) {
- case kw_long:
- getsym();
- ***************
- *** 270,287 ****
- TYP *temp1, *temp2, *temp3, *temp4;
- decl1_level++;
- /* for now just swallow "const" and "volatile" */
- ! switch (lastst) {
- ! case kw_const:
- ! getsym();
- ! if (lastst == kw_volatile)
- ! getsym();
- ! break;
- ! case kw_volatile:
- ! getsym();
- ! if (lastst == kw_const)
- ! getsym();
- ! break;
- ! }
- switch (lastst) {
- case id:
- declid = strsave(lastid);
- --- 285,291 ----
- TYP *temp1, *temp2, *temp3, *temp4;
- decl1_level++;
- /* for now just swallow "const" and "volatile" */
- ! qualifier();
- switch (lastst) {
- case id:
- declid = strsave(lastid);
- ***************
- *** 376,381 ****
- --- 380,386 ----
- case kw_char:
- case kw_short:
- case kw_unsigned:
- + case kw_signed:
- case kw_long:
- case kw_struct:
- case kw_union:
- ***************
- *** 387,393 ****
- case kw_const:
- case kw_volatile:
- do_decl:
- ! decl (proto);
- break;
- default:
- message(ERR_PARMS);
- --- 392,398 ----
- case kw_const:
- case kw_volatile:
- do_decl:
- ! decl ();
- break;
- default:
- message(ERR_PARMS);
- ***************
- *** 568,574 ****
- int no_append;
- static long old_nbytes;
- nbytes = 0;
- ! decl(table);
- dhead = head;
- for (;;) {
- declid = 0;
- --- 573,579 ----
- int no_append;
- static long old_nbytes;
- nbytes = 0;
- ! decl();
- dhead = head;
- for (;;) {
- declid = 0;
- ***************
- *** 1080,1085 ****
- --- 1085,1091 ----
- case kw_char:
- case kw_short:
- case kw_unsigned:
- + case kw_signed:
- case kw_long:
- case kw_struct:
- case kw_union:
-