Commit graph

21 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 10717cc791 Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
- Remove support for generating K&R code.
- Remove mkstemp and replace by tmpnam (more portable but less safe)
2019-02-19 00:54:23 +08:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
David Given c1aca7dae5 First milestone of replacing the build system.
--HG--
branch : dtrg-buildsystem
rename : lang/cem/cpp.ansi/Parameters => lang/cem/cpp.ansi/parameters.h
2013-05-12 20:45:55 +01:00
ceriel c2607fdf0f Added non-correcting error recovery stuff 1997-02-21 11:27:57 +00:00
ceriel 525eb1f1a4 Fixed typo 1995-07-31 09:17:14 +00:00
ceriel 7b6d8fbe56 Added copyright notice 1995-07-31 09:10:42 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 35260bae58 produce ANSI C under -a option 1991-11-26 15:38:41 +00:00
ceriel 6fa0e5bfb0 Changed copyright notice, made installation less dependent on ACK 1991-11-23 10:41:43 +00:00
ceriel 03e1bea097 Added some tests and changed ordering mechanism 1991-11-01 10:37:26 +00:00
ceriel db572116e1 Added a flag to not give warnings 1987-11-27 11:04:07 +00:00
ceriel 985a52b415 some bug fixes 1987-05-12 18:23:09 +00:00
ceriel 9a07fc841f Default paths were computed wrong. This is corrected. 1987-03-16 22:26:03 +00:00
ceriel 5537abbdfb Added copyright notice 1987-03-10 01:26:51 +00:00
ceriel de5ac65dd6 Bug fix. Error recovery did not always work as expected. The generated
parser sometimes assumed that a token would not be deleted, and inserted
tokens in front of it, and then deleted the token after all. It should
at each error, first delete, and then insert.
1986-10-29 11:16:55 +00:00
ceriel f055d610d3 Completely new version, generating a much faster parser. 1985-11-25 15:47:51 +00:00
ceriel aab6140bfa different interface. 1985-10-03 17:19:14 +00:00
ceriel d07e8114c6 More safety, also after terms and nonterminals. 1985-10-03 12:38:55 +00:00
ceriel b83ab7873e A more precise safety after a term. 1985-10-02 22:49:16 +00:00
ceriel 73153b484b Initial revision 1985-10-02 22:20:04 +00:00