From 34521231068fe2217491f1d530d5e03dbe15d9f7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 1 Apr 2023 09:39:10 -0700 Subject: [PATCH] Fix 1988/isaak for modern systems The problem was the exit() (redefined) was not being called in main(). This used to work but no longer does. This fix was based on the file on the IOCCC website isaak.ansi.c. One of the fixes in that one was the fact that in the older days one could define define to something else and use that new macro as a define. But since this was already done I didn't see the point in doing it again (it was already in the repo as the diff shows - isaak.alt.c is the original). Removed this entry from bugs.md. --- 1988/isaak/README.md | 25 ++++++++++++++++++------- 1988/isaak/isaak.c | 2 +- bugs.md | 9 --------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/1988/isaak/README.md b/1988/isaak/README.md index f85c3dbac..22d61cc07 100644 --- a/1988/isaak/README.md +++ b/1988/isaak/README.md @@ -15,10 +15,14 @@ ./isaak +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work for +modern systems. The problem was that the important function, a redefinition of +exit(), was not being called in main(). See below notes for the original, +alternative version. Thank you Cody for your assistance! + ### Alternate code: -An alternate version of this entry, `isaak.alt.c`. - +The original version of this code is in [isaak.alt.c](isaak.alt.c). The original entry starts with the line: main(){}; @@ -26,7 +30,12 @@ The original entry starts with the line: This works on some systems. Why? Note that `#include ` is given on the last line. Why is this needed? Note the unusual calls to sprintf. -## Judges' comments +This version also relied on being able to define define to something else and +using that macro for `#define`. This version will not likely work on modern +systems if you can even get it to compile. + + +## Judges' comments: NOTE: The program relies heavily on ASCII. Don't even think of running it on an EBCDIC machine. If you name the file anything other than "isaak.c", you must @@ -36,15 +45,17 @@ NOTE: The use of null comments to separate macros to construct different tokens from a single macro (e.g., `"O/**/O"` creates either `++` or `--` by defining `O` to be `+` or `-`) may cause some strict ANSI C preprocessors to object. -NOTE: Most System V machines will not be able to execute this program correctly +NOTE: Most System V machines were not be able to execute this program correctly due to the fact that BSD style systems have an sprintf() that returns a `char *`. - -Due to the above problems, we have placed the output of this program -in the file: isaak.encode. To read this file do: +Due to the above problems, we placed the output of this program in the file: +isaak.encode. To read this file do: uudecode < isaak.encode cat isaak.output +But since Cody fixed it this is not strictly necessary. See the +[isaak.alt.c](isaak.alt.c) for the original source. + FYI: We are likely to be more strict about portability in the future. ## Copyright and CC BY-SA 4.0 License: diff --git a/1988/isaak/isaak.c b/1988/isaak/isaak.c index 046ee8c45..de06148c6 100644 --- a/1988/isaak/isaak.c +++ b/1988/isaak/isaak.c @@ -1,4 +1,4 @@ -main(){} +main(){exit(0);} #define U #define main Si #if U defined(y) diff --git a/bugs.md b/bugs.md index 88d1a605b..8936638e8 100644 --- a/bugs.md +++ b/bugs.md @@ -357,15 +357,6 @@ 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). -## [1988/isaak/isaak.com) ([README.md](1988/isaak/README.md)) -## STATUS: known bug - please help us fix - -This currently prints nothing. [Cody Boone -Ferguson](/winners.html#Cody_Boone_Ferguson) is working on this along with other -things and there is a known fix even besides if he decides his time would be -better spent on something else here or in that elusive thing called 'real life'. - - # 1989