Commit graph

13 commits

Author SHA1 Message Date
David Given f8fc5bc3d8 Implement single-line C++-style comments.
Fixes: #118
2018-09-02 12:14:59 +02:00
David Given 788f439a48 Run files through clang-format before editing. 2018-09-02 11:16:06 +02:00
George Koehler ddf9de3f49 strcpy() is in <string.h> 2017-11-13 17:57:02 -05:00
George Koehler 59b3c10563 Use (arith) 1 << ... when getting the sign bit.
This prevents an overflow reported by @hexcoder- in
https://github.com/davidgiven/ack/issues/56

lang/cem/cpp.ansi/LLlex.c used a plain 1 << ... and caused an overflow
on machines where sizeof(int) < sizeof(long).  Using 1L << ... would
work for now but might fail later if arith became long long.

C doesn't specify whether negative integers use 2's complement or some
other format.  Therefore, (arith) 1 << ... has an undefined value.  It
should still work because the value is some integer where the sign bit
is set and all other bits are clear.

(unsigned arith) 1 << ... would also get the sign bit, but casting it
from unsigned back to signed would make the same undefined value.

(arith) -1 << ... would assume 2's complement.
2017-10-29 17:45:10 -04:00
David Given 3e69d1185a Fix a whole lot more stray prototypes. 2016-11-24 21:47:40 +01: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 1db6a3029b Header --> Id 1994-06-24 14:02:31 +00:00
ceriel 6fc94eb375 Improved constant arithmetic: had several bugs 1993-03-18 13:24:20 +00:00
ceriel 5ba9685e76 de-linted somewhat 1990-10-02 17:19:17 +00:00
eck 7987a1fed8 cast ptrdiff_t to int for ANSI 1990-04-25 15:10:13 +00:00
eck 197379a33a fixed bug with character constants 1990-02-01 13:09:40 +00:00
eck 1d37165575 Initial revision 1989-10-23 10:35:56 +00:00