From 12d045f32ad442d50e8b7569b43e67cdf0b2608f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:13:18 -0700 Subject: [PATCH 1/4] Remove address from 2000/thadgavin --- 2000/thadgavin/README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/2000/thadgavin/README.md b/2000/thadgavin/README.md index b335a4c5a..eaad2a6c0 100644 --- a/2000/thadgavin/README.md +++ b/2000/thadgavin/README.md @@ -1,16 +1,10 @@ # Most Portable Output Thaddaeus Frogley -Creature Labs -164 Hornbeams -Harlow, Essex UK Gavin Buttimore -Creature Labs -9 Elizabeth Way -Cambridge -UK, CB4 1DE +UK ## To build: From 80844970c67a898f92318bd84a27eb0aa1e53186 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:14:24 -0700 Subject: [PATCH 2/4] Typo fix in 2011/fredriksson/README.md This was found quite by accident: another pass of the file will be done once all the README.md files have been formatted (it seems like I will be able to resume somewhere in year 2013). --- 2011/fredriksson/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2011/fredriksson/README.md b/2011/fredriksson/README.md index 5c1c2ec15..39ccf5d54 100644 --- a/2011/fredriksson/README.md +++ b/2011/fredriksson/README.md @@ -208,7 +208,7 @@ Just say * Algorithmically, it incorporates the following - (inverse) Burrows-Wheeler transform (used also e.g. in bzip2) - - data compression (really expansion :-), run-lenght-encoding, + - data compression (really expansion :-), run-length-encoding, unary coding (this is why it is expansion rather than compression) - approximate string matching - dynamic programming to compute the edit distance From 8dc6e39fda085f240ac9a3153349bff017f0d929 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:42:54 -0700 Subject: [PATCH 3/4] Update bugs and thanks for 1992/lush I also removed a -Wno- option from the Makefile as the entry relies on this warning. This is not strictly necessary as the script that I added, runme.sh, directly compiles it, but it felt like it shouldn't have it anyway. In the bugs.md file I gave some hints as to why this does not work with clang. In the thanks file I broke up a paragraph into more than one paragraph. --- 1992/lush/Makefile | 2 +- bugs.md | 64 ++++++++++++++++++++++++++++++++++++++++++++- thanks-for-fixes.md | 13 ++++++--- 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/1992/lush/Makefile b/1992/lush/Makefile index 5fbb21498..569f712e6 100644 --- a/1992/lush/Makefile +++ b/1992/lush/Makefile @@ -38,7 +38,7 @@ include ../../var.mk # Common C compiler warnings to silence # -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-macro-redefined \ +CSILENCE= -Wno-error -Wno-implicit-function-declaration \ -Wno-strict-prototypes # Common C compiler warning flags diff --git a/bugs.md b/bugs.md index 4d797ca63..8909091ba 100644 --- a/bugs.md +++ b/bugs.md @@ -736,7 +736,69 @@ work but it only works with gcc. Cody removed the warnings of `gets()`. Unfortunately due to the way the entry works and the fact that other compilers like clang have different warnings and errors this simply does not work with -them. Can you help us? +them. + +Some tips from Cody: + +This entry relies on specific compiler warnings. With gcc it will look something +like: + +``` +[...] +lush.c: In function 'main': +lush.c:40: warning: "f" redefined + 40 | main + | +lush.c:1: note: this is the location of the previous definition + 1 | #define gets(_) fgets((_),999,stdin) + | +lush.c:42: warning: "f" redefined + 42 | #define f 001: + | +lush.c:40: note: this is the location of the previous definition + 40 | main + | +lush.c:44: warning: "f" redefined + 44 | #define f 100: + | +lush.c:42: note: this is the location of the previous definition + 42 | #define f 001: + | +lush.c:45: warning: "f" redefined + 45 | _[i-- + | +lush.c:44: note: this is the location of the previous definition + 44 | #define f 100: + | +lush.c:46: warning: "f" redefined + 46 | #define f 126: + | +lush.c:45: note: this is the location of the previous definition + 45 | _[i-- + | +``` + +Now one can use `sed` to get the `warning:` line correct but there is more to it +than that. For instance this is what it looks like with clang: + +``` +lush.c:40:9: warning: 'f' macro redefined [-Wmacro-redefined] +#define f 001: + ^ +lush.c:1:9: note: previous definition is here +#define f 000: + ^ +lush.c:42:9: warning: 'f' macro redefined [-Wmacro-redefined] +#define f 100: + ^ +lush.c:40:9: note: previous definition is here +#define f 001: + ^ +``` + +As you might see the part under the `warning:` line is different. + +Can you help us? ## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md)) ## STATUS: INABIAF - please **DO NOT** fix diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 953a14ba8..3a839e0dc 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -642,6 +642,9 @@ it moves towards the right but if you click the mouse it goes back. Yusuke supplied a patch which makes this work with gcc. Due to how it works (see Judges' remarks in the README.md file) this will not work with clang. +Cody also provided the `runme.sh` script to demonstrate it as using make was +problematic. + Cody made it use `fgets()` instead of `gets()` to prevent annoying warnings getting in the way (in linux linking in a binary with `gets()` produces a warning that might get in the way with this entry and in macOS at runtime it @@ -652,8 +655,10 @@ with clang due to different compiler messages. Cody later improved the `fgets()` change to look more like the original i.e. it now uses a redefined `gets()`. This did require modifying the line number with -`#line 1` under the macro `gets()`. Still this cannot work with clang due to -different compiler messages. See [bugs.md](/bugs.md) for details. +`#line 1` under the macro `gets()`. + +Still this cannot work with clang due to different compiler messages. See +[bugs.md](/bugs.md) for details. ## [1992/nathan](1992/nathan/nathan.c) ([README.md](1992/nathan/README.md)) @@ -795,7 +800,9 @@ Cody fixed this so that it would work with macOS. Once it could compile it additionally segfaulted under macOS which he also fixed. Cody also provided the [Alternate code](1995/cdua/cdua.alt.c) for fun :-) ) (in particular to make it easier to see the program do what it does in systems that are too fast ... if -there is such a thing anyway :-) ). +there is such a thing anyway :-) ). See the README.md for details on this. + + ## [1995/garry](1995/garry/garry.c) ([README.md](1995/garry/README.md])) From 71eed0c67458029ed76d3d6941beb729810f0ef6 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:52:48 -0700 Subject: [PATCH 4/4] Add important note to 1989/fubar/README.md In the judges' remarks they refer to ouroboros.c as being an executable but it's not in the repo. This is because it's created by the program itself. It happens to be in .gitignore but this note should make it less confusing and prevent people from thinking that a file is actually missing. --- 1989/fubar/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/1989/fubar/README.md b/1989/fubar/README.md index 3c274babf..3a5055c76 100644 --- a/1989/fubar/README.md +++ b/1989/fubar/README.md @@ -33,10 +33,13 @@ Run this with a single digit argument (or wait a long time). The blank line at the beginning of the source is mandatory. Do you know why? -NOTE: don't try running [ouroboros.c](ouroboros.c) (note that it's executable) +NOTE: don't try running `ouroboros.c` (note that it's executable) directly with an arg as it'll turn into an infinite loop. The same will happen with larger numbers. +NOTE: the file `ouroboros.c` is created by the program itself so this is why it +is not in the repository. + ## Author's remarks: In a nutshell, this is probably the slowest and most