ack/lang/cem/cemcom.ansi
George Koehler 15950f9c95 Add long long literals like 123LL to ACK C.
For now, a long long literal must have the 'LL' or 'll' suffix.  A
literal without 'LL' or 'll' acts as before: it may become unsigned
long but not long long.  (For targets where int and long have the same
size, some literals change from unsigned int to unsigned long.)

Type `arith` may be too narrow for long long values.  Add a second
type `writh` for wide arithmetic, and change some variables from arith
to writh.  This may cause bugs if I forget to use writh, or if a
conversion from writh to arith overflows.  I mark some conversions
with (arith) or (writh) casts.

 - BigPars, SmallPars: Remove SPECIAL_ARITHMETICS.  This feature
   would change arith to a different type, but can't work, because it
   would conflict with definitions of arith in both <em_arith.h> and
   <flt_arith.h>.
 - LLlex.c: Understand 'LL' or 'll' suffix.  Cut size of constant when
   it overflows writh, not only when it overflows the target machine's
   types.  (This cut might not be necessary, because we might cut it
   again later.)  When picking signed long or unsigned long, check the
   target's long type, not the compiler's arith type; the old check
   for `val >= 0` was broken where sizeof(arith) > 4.
 - LLlex.h: Change struct token's tok_ival to writh, so it can hold a
   long long literal.
 - arith.c: Adjust to VL_VALUE being writh.  Don't convert between
   float and integer at compile-time if the integer might be too wide
   for <flt_arith.h>.  Add writh2str(), because writh might be too
   wide for long2str().
 - arith.h: Remove SPECIAL_ARITHMETICS.  Declare full_mask[] here,
   not in several *.c files.  Declare writh2str().
 - ch3.c, ch3bin.c, ch3mon.c, declarator.c, statement.g: Remove
   obsolete casts.  Adjust to VL_VALUE being writh.
 - conversion.c, stab.c: Don't declare full_mask[].
 - cstoper.c: Use writh for constant operations on VL_VALUE, and for
   full_mask[].
 - declar., field.c, ival.g: Add casts.
 - dumpidf.c: Need to #include "parameters.h" before checking DEBUG.
   Use writh2str, because "%ld" might not work.
 - eval.c, eval.h: Add casts.  Use writh when writing a wide constant
   in EM.
 - expr.c: Add and remove casts.  In fill_int_expr(), make expression
   from long long literal.  In chk_cst_expr(), allow long long as
   constant expression, so the compiler may accept `case 123LL:` in a
   switch statement.
 - expr.str: Change struct value's vl_value and struct expr's VL_VALUE
   to writh, so an expression may have a long long value at compile
   time.
 - statement.g: Remove obsolete casts.
 - switch.c, switch.str: Use writh in case entries for switch
   statements, so `switch (ll) {...}` with long long ll works.
 - tokenname.c: Add ULNGLNG so LLlex.c can use it for literals.
2019-09-04 22:14:38 -04:00
..
align.h Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
arith.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
arith.h Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
atw.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
BigPars Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
blocks.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
blocks.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
build.lua Rip out the built-in preprocessor from cemcom.ansi, now it's no longer used. 2018-09-02 12:50:50 +02:00
cemcom.ansi.1 Add missing C compiler command line option. 2019-05-11 01:07:33 +08:00
ch3.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
ch3.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3bin.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
ch3bin.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3mon.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
ch3mon.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
char.tab We can build our first C file. 2016-08-07 21:56:53 +02:00
class.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
code.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
code.str * Remove some more compiler warnings. 2019-02-24 00:46:05 +08:00
conversion.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
conversion.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
cstoper.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
cstoper.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dataflow.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dataflow.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
declar.g Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
declar.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
declarator.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
declarator.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
decspecs.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
decspecs.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
def.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
domacro.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
domacro.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dumpidf.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
error.c Fix issue again with wrong macro on error. 2019-02-26 00:46:10 +08:00
error.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
estack.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
eval.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
eval.h Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
expr.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
expr.str Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
expression.g Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
field.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
field.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
file_info.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
fltcstoper.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
fltcstoper.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
idf.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
idf.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
input.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
input.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
interface.h Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
ival.g Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
l_brace.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_class.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_comment.c First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
l_comment.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_em.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_ev_ord.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
l_lint.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
l_lint.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_misc.c First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
l_outdef.c bts2str(), long2str() are in <ack_string.h> 2017-11-10 18:00:00 -05:00
l_outdef.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_state.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_states.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
label.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
label.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
level.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
LLlex.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
LLlex.h Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
LLmessage.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
macro.str Rip out the built-in preprocessor from cemcom.ansi, now it's no longer used. 2018-09-02 12:50:50 +02:00
main.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
make.allocd Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-18 16:45:57 +00:00
make.hfiles Now avoids piping shell scripts into a new instance of sh, instead 2006-07-26 12:29:47 +00:00
make.next First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
make.tokcase Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-19 10:30:26 +00:00
make.tokfile Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-19 10:30:26 +00:00
mes.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
next.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
options fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
options.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
options.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
pragma.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
pragma.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
program.g Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
proto.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
proto.main fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
proto.make fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
proto.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
sizes.h Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
skip.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
skip.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
SmallPars Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
specials.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
stab.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
stab.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stack.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stack.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
statement.g Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
stb.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stmt.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
struct.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
struct.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
switch.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
switch.str Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
tokcase.sed Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokcasee.in Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokcaseh.in Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokenname.c Add long long literals like 123LL to ACK C. 2019-09-04 22:14:38 -04:00
tokenname.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
type.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
type.str Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
util.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
util.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00