Merge pull request #815 from xexyl/1988-applin-alt-zsmall

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-05-31 06:37:05 -07:00
commit b34463f563
4 files changed
+23 -5

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
applin
large.c
zsmall
applin.alt
+6 -2
View File
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ= zsmall.o
ALT_TARGET= zsmall
ALT_OBJ= applin.alt.o
ALT_TARGET= applin.alt
#################
@@ -147,6 +147,10 @@ ${PROG}: ${PROG}.c
alt: data ${ALT_TARGET}
@${TRUE}
${ALT_TARGET}: ${PROG}.alt.c
${CP} -f ${PROG}.alt.c zsmall.c
${CC} ${CFLAGS} zsmall.c -o $@
# not an official entry
#
# The 'zsmall.c' program was obtained from 'applin.c' by reducing its recursion
+16 -3
View File
@@ -10,12 +10,28 @@ US
make all
```
A smaller version, originally called `zsmall.c`, of [applin.c](applin.c) can be
found in [applin.alt.c](applin.alt.c). Your machine may have an easier time
with this program. See the Alternate code section below for details.
## Try:
```sh
./applin
```
### Alternate code:
As noted above a smaller version can be used in case your cpp has a hard time
with this entry. To use:
```sh
make alt
```
Use `applin.alt` as you would `applin` above.
## Judges' remarks:
This entry is by far the most unusual abuse of the C preprocessor that
@@ -34,9 +50,6 @@ on the Amdahl 5890-300E. But due to the ANSI-likeness of GNU cpp (v. 1-21),
it was not able to cleanly substitute a symbol that began with a '#'.
Clearly the GNU C preprocessor is faster.
A smaller version of [applin.c](applin.c) can be found in [zsmall.c](zsmall.c).
Your machine may have an easier time with this program. See the Makefile for
details.
## Author's remarks:
File renamed without changes.