From fa8a9b8b28a6b69a6b4efd74a45402f745e280b3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 5 Apr 2023 06:16:26 -0700 Subject: [PATCH 1/2] Remove 1985/sicherman -traditional-cpp requirement For some good old C-fashioned fun I recommend people to compare sicherman.c to sicherman.alt.c! To the best of my knowledge with this there are no more entries that require -traditional-cpp! The configure scripts in 2004/hibachi and 2005/mynx don't seem to be required to compile the code. It's possible that other entries do need it that I've not yet discovered but as of now no known entries need it. Removed entry from bugs.md. --- 1985/sicherman/.gitignore | 1 + 1985/sicherman/Makefile | 14 +++++--------- 1985/sicherman/README.md | 28 +++++++++++++++++++++++++--- 1985/sicherman/sicherman.alt.c | 23 +++++++++++++++++++++++ 1985/sicherman/sicherman.c | 28 ++++++++-------------------- bugs.md | 13 ------------- 6 files changed, 62 insertions(+), 45 deletions(-) create mode 100644 1985/sicherman/sicherman.alt.c diff --git a/1985/sicherman/.gitignore b/1985/sicherman/.gitignore index 82b0ebb1e..7cf6dfe81 100644 --- a/1985/sicherman/.gitignore +++ b/1985/sicherman/.gitignore @@ -1 +1,2 @@ sicherman +sicherman.alt diff --git a/1985/sicherman/Makefile b/1985/sicherman/Makefile index 1e841f9c1..3ff5c547d 100644 --- a/1985/sicherman/Makefile +++ b/1985/sicherman/Makefile @@ -61,7 +61,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= +CINCLUDE= -include unistd.h # Optimization # @@ -111,12 +111,9 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt -# FORCE use of -traditional-cpp -# -CFLAGS+= -traditional-cpp ################# # build the entry @@ -130,13 +127,12 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: NOTE: this entry requires a compiler that supports -traditional-cpp." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable # -alt: data ${ALT_TARGET} - @${TRUE} +alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -traditional-cpp $< -o $@ ${LIBS} # data files # diff --git a/1985/sicherman/README.md b/1985/sicherman/README.md index d460128ff..5cd71a3a8 100644 --- a/1985/sicherman/README.md +++ b/1985/sicherman/README.md @@ -4,13 +4,35 @@ Col. G. L. Sicherman ## To build: - make all +```sh +make all +``` -NOTE: This entry requires a compiler that support `-traditional-cpp`. + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this very twisted +entry to not require `-traditional-cpp`. He'd like to refer you to the original +file in [sicherman.alt.c](sicherman.alt.c) and he suggests that you then compare +it to [sicherman.c](sicherman.c) for some good old C-fashioned fun! Thank you +Cody for your assistance! ## Try: - ./sicherman < sicherman.c +```sh +./sicherman < sicherman.c + +echo IOCCC | ./sicherman +``` + +### Alternate code: + +If you do have a compiler that supports `-traditional-cpp` you may compile the +original like: + +```sh +make alt +``` + +Use `sicherman.alt` as you would `sicherman`. ## Judges' comments: diff --git a/1985/sicherman/sicherman.alt.c b/1985/sicherman/sicherman.alt.c new file mode 100644 index 000000000..5070cc8de --- /dev/null +++ b/1985/sicherman/sicherman.alt.c @@ -0,0 +1,23 @@ +#define C_C_(_)~' '&_ +#define _C_C(_)('\b'b'\b'>=C_C>'\t'b'\n') +#define C_C _|_ +#define b * +#define C /b/ +#define V _C_C( +main(C,V) +char **V; +/* C program. (If you don't + * understand it look it + */ up.) (In the C Manual) +{ + char _,__; + while (read(0,&__,1) & write((_=(_=C_C_(__),C)), + _C_,1)) _=C-V+subr(&V); +} +subr(C) +char *C; +{ + C="Lint says "argument Manual isn't used." What's that + mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ + '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); +} diff --git a/1985/sicherman/sicherman.c b/1985/sicherman/sicherman.c index 5070cc8de..ee4afc85e 100644 --- a/1985/sicherman/sicherman.c +++ b/1985/sicherman/sicherman.c @@ -1,23 +1,11 @@ -#define C_C_(_)~' '&_ -#define _C_C(_)('\b'b'\b'>=C_C>'\t'b'\n') -#define C_C _|_ -#define b * -#define C /b/ -#define V _C_C( -main(C,V) -char **V; -/* C program. (If you don't - * understand it look it - */ up.) (In the C Manual) +main(/*/,('\b'*'\b'>=_|_>'\t'*'\n') +char **('\b'*'\b'>=_|_>'\t'*'\n') (in the /*/ manual) { char _,__; - while (read(0,&__,1) & write((_=(_=C_C_(__),C)), - _C_,1)) _=C-V+subr(&V); -} -subr(C) -char *C; -{ - C="Lint says "argument Manual isn't used." What's that - mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ - '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); + while (read(0,&__,1) & write((_=(_=~' '&__,/*/)), + _C_,1)) _=/*/-('\b'*'\b'>=_|_>'\t'*'\n'))?__:__-_+ + + + '\b'*'\b'|((_-52)%('\b'*'\b'+~' '&'\t'*'\n')+1),1),&_,1)); } + diff --git a/bugs.md b/bugs.md index e8ac9a21c..90e12ecc6 100644 --- a/bugs.md +++ b/bugs.md @@ -247,19 +247,6 @@ continues to run. We have not had a chance to try and fix this yet. -## [1985/sicherman](1985/sicherman/sicherman.c) ([README.md](1985/sicherman/README.md)) -## STATUS: Requires a compiler supporting `-traditional-cpp` - alternate code requested - -This entry needs a compiler that support `-traditional-cpp`. `gcc` -supports this but `clang` does not. Please be advised that `gcc` under macOS is -actually gcc if it looks like it's gcc (two different binaries). - -If you do wish to provide an alternate version of the program that does not need -compiler supporting we welcome you to summit such code via a -[GitHub pull request](https://github.com/ioccc-src/temp-test-ioccc/pulls) and we -will be happy to credit you in the entry's _README.md_ file. - - # 1986 From eb395363c82d4fc7f9546d7ab72fa3558bed84f7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 5 Apr 2023 09:06:24 -0700 Subject: [PATCH 2/2] Minor update to 1985/sicherman Try and make it look a bit more like the original but still work without -traditional-cpp. --- 1985/sicherman/sicherman.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/1985/sicherman/sicherman.c b/1985/sicherman/sicherman.c index ee4afc85e..dee59b753 100644 --- a/1985/sicherman/sicherman.c +++ b/1985/sicherman/sicherman.c @@ -1,5 +1,8 @@ main(/*/,('\b'*'\b'>=_|_>'\t'*'\n') -char **('\b'*'\b'>=_|_>'\t'*'\n') (in the /*/ manual) +char **('\b'*'\b'>=_|_>'\t'*'\n') +* C program. (If you don't +* understand it look it +* up.) (In the /*/ /*C*/ manual) { char _,__; while (read(0,&__,1) & write((_=(_=~' '&__,/*/)),