Commit graph

17 commits

Author SHA1 Message Date
David Given 28d4480f62 It turns out that you can't use freopen() to set binary mode of
stdin/stdout on Windows; so add a new system function called
sys_setbinarymode which does it instead. Then find lots more binary mode
flags which need setting.
2022-07-17 20:47:53 +02:00
George Koehler fc1476c88b Add -DDEBUG to enable assertions in util/ego
Our build enables assertions in some other ACK tools (like assemblers
and LLgen), but disabled them in ego until now.  Bug #203 becomes a
failed assertion in ego's SR phase:

    sr: util/ego/sr/sr_reduce.c:483: fix_header: Assertion
    `INSTR(e) == ps_end' failed.

Comment out 2 assertions in util/ego/share, because they fail on
systems with 4-byte int, 8-byte long.
2019-11-14 17:17:24 -05:00
George Koehler 36f16b0cb8 Cut down some clang warnings
Edit C code to reduce warnings from clang.  Most warnings are for
implicit declarations of functions, but some warnings want me to add
parentheses or curly braces, or to cast arguments for printf().

Make a few other changes, like declaring float_cst() in h/con_float to
be static, and using C99 bool in ego/ra/makeitems.c and
ego/share/makecldef.c.  Such changes don't silence warnings; I make
such changes while I silence warnings in the same file.  In
float_cst(), rename parameter `str` to `float_str`, so it doesn't
share a name with the global variable `str`.

Remove `const` from `newmodule(const char *)` in mach/proto/as to
silence a warning.  I wrongly added the `const` in d347207.

For warnings about implicit declarations of functions, the fix is to
declare the function before calling it.  For example, my OpenBSD
system needs <sys/wait.h> to declare wait().

In util/int, add "whatever.h" to declare more functions.  Remove old
declarations from "mem.h", to prefer the newer declarations of the
same functions in "data.h" and "stack.h".
2019-10-30 18:36:38 -04:00
David Given 9e2d45b301 Rename all files called 'aux.*' to something else; Windows can't handle them. 2019-02-09 00:02:41 +01:00
George Koehler 12643f1740 Solve some gcc warnings in ego.
Some of these are from gcc -Wimplicit
2018-03-08 18:51:07 -05:00
George Koehler 9037d137f5 Add prototypes, void in util/ego/share
This uncovers a problem in il/il_aux.c: it passes 3 arguments to
getlines(), but the function expects 4 arguments.  I add FALSE as the
4th argument.  TRUE would fill in the list of mesregs.  IL uses
mesregs during phase 1, but this call to getlines() is in phase 2.
TRUE would leak memory unless I added a call to Ldeleteset(mesregs).
So I pass FALSE.

Functions passed to go() now have a `void *` parameter because
no_action() now takes a `void *`.
2017-11-15 17:19:56 -05:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 0c60f4c22f Fixed several lint complaints 1993-11-16 11:35:23 +00:00
ceriel 27d53b0d33 Changed #include's 1991-03-05 12:44:05 +00:00
ceriel 1139272435 Changed types in core allocation routines, changed lint flags 1990-12-17 14:55:03 +00:00
ceriel 79ac11bd40 Made to compile with DEBUG off 1988-09-02 13:55:54 +00:00
ceriel aad62add90 Bug fix: a character was compared to op_lab, which is >= 128. 1987-04-03 16:48:53 +00:00
ceriel 6eaf182cee Added Rcs Id 1987-03-10 11:49:39 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
bal 4ab54c85a8 As getbblocks() was moved to cf.c, em_flag.h need no longer
be included.; also, the declaration for em_flag[] was removed.
1984-11-30 10:10:41 +00:00
bal 582a0cc2aa getbblocks() removed (now local to CF phase),
getcall(),getcc() and get_text removed (now local to IL),
get_ca_lines() removed (now local to CA),
current input file "f" renamed "curinp" and exported,
getbyte (macro), getshort() and getoff() exported
read_line() and getlines() exported,
lastbid and lastlabid exported.
1984-11-29 10:15:23 +00:00
bal 6d481ce4d6 Initial revision 1984-11-26 15:04:22 +00:00