Commit graph

16 commits

Author SHA1 Message Date
George Koehler 8bb395b147 LLgen: use size_t, reduce warnings, other small changes
Use C89 size_t for sizes from sizeof() or to malloc() or realloc().
Remove obsolete (unsigned) casts.  Sizes were unsigned int in
traditional C but are size_t in C89.

Silence some clang warnings.  Add the second pair of round brackets in
`while ((ff = ff->ff_next))` to silence -Wparentheses.  Change
`if (nc_first(...))/*nothing*/;` to `(void)nc_first(...);` to silence
-Wempty-body.  The code in compute.c nc_first() had the form
`if (x) if (y) s; else t;`.  The old indentation (before 10717cc)
suggests that the "else" belongs to the 2nd "if", so add braces like
`if (x) { if (y) s; else t; }` to silence -Wdangling-else.

Shuffle extern function declarations.  Add missing declaration for
LLparse().  Stop declaring RENAME(); it doesn't exist.  Move some
declarations from main.c to extern.h, so the C compiler may check that
the declarations are compatible with the function definitions.

Assume that standard C89 remove() is available and doesn't need the
UNLINK() wrapper.

In lib/incl, don't need to include <stdio.h> nor <stdlib.h> to use
assert().

Remove alloc.h.  If you don't clean your build, then an outdated
BUILDDIR/obj/util/LLgen/headers/alloc.h will survive but should not
cause harm, because nothing includes it.  Don't need to remove alloc.h
from util/LLgen/distr.sh, because it isn't there.

Run the bootstrap to rebuild LLgen.c, Lpars.c, tokens.c.
2019-10-22 15:32:23 -04:00
carl 42bbdec82d Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
2019-02-19 00:54:23 +08:00
ceriel 664d3fc8d3 some minor fixes 1997-02-21 15:44:10 +00:00
ceriel c2607fdf0f Added non-correcting error recovery stuff 1997-02-21 11:27:57 +00:00
ceriel a1a816ddc2 Avoid some empty if- and else- parts. gcc -Wall does not like it 1994-10-20 12:43:35 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 656fb00e9b Fix: error recovery sometimes skipped tokens it needed later on 1994-04-19 09:38:00 +00:00
ceriel 35260bae58 produce ANSI C under -a option 1991-11-26 15:38:41 +00:00
ceriel 8c6dc46124 allow for multiple parsers within one program 1990-01-29 13:51:32 +00:00
ceriel e67a70cbea LLscan either macro or function 1988-06-24 14:55:27 +00:00
ceriel 123b73506d inline scan 1988-06-24 14:26:35 +00:00
ceriel e1f7d20251 modified generation of token mapping somewhat 1988-06-24 11:48:10 +00:00
ceriel a27fac26db hide some names 1988-06-24 09:31:28 +00:00
ceriel 255884b3fb Another adaption to allow for user intervention BEFORE error recovery 1987-02-16 21:36:05 +00:00
ceriel 8b48512de7 New version, with a much faster parser. 1985-11-25 15:50:51 +00:00
ceriel a21f936651 Initial revision 1984-10-08 14:14:53 +00:00