From 8d4ce3b843ba3ff0630ec18517199708246d3534 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 27 Oct 2023 05:36:00 -0700 Subject: [PATCH] Make 1985/sicherman even more like original By changing some macros to what they used to expand to more of the code can be used / not commented out. For instance now subr() no longer is commented out. It cannot be used but it now is uncommented to make it more like the original, even using the C macro as the arg (albeit without a type specified as it actually just translates to /**/). The macro that C used to use, 'b' (which is '*'), is still used just not in C as doing so will cause compilation problems. The single arg of main() was commented out because some versions of clang do not only allow one arg to main(). There might have been other things to make it more like the original as well. --- 1985/sicherman/Makefile | 5 +++-- 1985/sicherman/sicherman.c | 19 ++++++++----------- thanks-for-fixes.md | 13 ++++++++----- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/1985/sicherman/Makefile b/1985/sicherman/Makefile index 16c13b836..d121f26eb 100644 --- a/1985/sicherman/Makefile +++ b/1985/sicherman/Makefile @@ -39,7 +39,8 @@ include ../../var.mk # Common C compiler warnings to silence # CSILENCE= -Wno-comment -Wno-deprecated-non-prototype -Wno-main -Wno-pedantic \ - -Wno-return-type -Wno-strict-prototypes -Wno-unused-parameter -Wno-implicit-int + -Wno-return-type -Wno-strict-prototypes -Wno-unused-parameter -Wno-implicit-int \ + -Wno-implicit-function-declaration -Wno-unused-value -Wno-multichar # Common C compiler warning flags # @@ -62,7 +63,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= -include unistd.h +CINCLUDE= # Optimization # diff --git a/1985/sicherman/sicherman.c b/1985/sicherman/sicherman.c index 442d97158..3bf29ef24 100644 --- a/1985/sicherman/sicherman.c +++ b/1985/sicherman/sicherman.c @@ -2,28 +2,25 @@ #define _C_C(_)('\b'b'\b'>=C_C>'\t'b'\n') #define C_C _|_ #define b * -#define C /b b/ +#define C /**/ #define V _C_C( +char _,__; main(/*C,V) char **V;*/ /* C program. (If you don't * understand it look it - * up.) (In the C */manual) + * up.) (In the C manual*/) { - char _,__; + char _,__; while (read(0,&__,1) & write((_=(_=~' '&__,/*/)), _C_,1)) _=/*/-('\b'*'\b'>=_|_>'\t'*'\n'))?__:__-_+ - - - '\b'*'\b'|((_-52)%('\b'*'\b'+~' '&'\t'*'\n')+1),1),&_,1)); + '\b'*'\b'|((_-52)%('\b'*'\b'+~' '&'\t'*'\n')+1),1), + &_,1))/*_=C-V+subr(&V)*/; } -#if 0 subr(C) -char *C; { - C="Lint says "argument Manual isn't used." What's that - mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ + "Lint says argument Manual isn't used." "What's that\ + mean?"; while (write((read(('"'-'/*"'/*"*/))?__:__-_+ '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); } -#endif diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 08352b3bf..fa06f20aa 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -11,15 +11,17 @@ contributed thousands, that we wish to thank. We call out the extensive contributions of [Cody Boone Ferguson](https://www.ioccc.org/winners.html#Cody_Boone_Ferguson) who is -responsible for most of the improvements and fixes including many **very +responsible for most of the improvements and fixes including many **extremely complicated bug fixes** like [1988/phillipps](/thanks-for-fixes.md#1988phillipps-readmemd), [2001/anonymous](/thanks-for-fixes.md#2001anonymous-readmemd) and [2004/burley](/thanks-for-fixes.md#2004burley-readmemd), making entries like +[1985/sicherman](/thanks-for-fixes.md#1985sicherman-readmemd) and [1986/wall](/thanks-for-fixes.md#1986wall-readmemd) not need `-traditional-cpp` -(all **very complicated fixes**), fixing entries to work with clang (some being -**very complicated** like [1991/dds](/thanks-for-fixes.md#1991dds-readmemd)), -porting entries to macOS (some being **very complicated** like +(all **extremely complicated fixes**), fixing entries to work with clang (some +being **extremely complicated** like +[1991/dds](/thanks-for-fixes.md#1991dds-readmemd)), porting entries to macOS +(some being **very complicated** like [1998/schweikh1](/thanks-for-fixes.md#1998schweikh1-readmemd)), fixing code like [2001/herrmann2](/thanks-for-fixes.md#2001herrmann2-readmemd) to work in both 32-bit/64-bit which *can be* **very complicated**, providing alternate code @@ -237,7 +239,8 @@ then compare it to [sicherman.c](1985/sicherman/sicherman.c) for some good old C-fashioned fun! Later on Cody improved the fix so that it looks much more like the [original -entry](1985/sicherman/sicherman.c). +entry](1985/sicherman/sicherman.c). He did this one more time and it's about as +close to the original as one can get without causing a compilation error. ## [1986/hague](1986/hague/hague.c) ([README.md](1986/hague/README.md]))