From aedc966d6d6ec0ae166f9e620067ae7ea8ed6bac Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 10 Sep 2023 06:43:49 -0700 Subject: [PATCH 1/3] Improve fgets() fix to 1992/lush gets() is now defined as the right fgets() call. This required the use of #line 1 as the entry uses compiler messages to work right. That's also why clang will not work with this entry. --- 1992/lush/lush.c | 6 ++++-- thanks-for-fixes.md | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/1992/lush/lush.c b/1992/lush/lush.c index dc088f4c9..b81db01bd 100644 --- a/1992/lush/lush.c +++ b/1992/lush/lush.c @@ -1,3 +1,5 @@ +#define gets(_) fgets((_),999,stdin) +#line 1 #define f 000: char *s,* @@ -63,8 +65,8 @@ ;;;} ;for ( ; - fgets - (_,999,stdin); + gets + (_); ) { for( #define f 301: diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index a444eaf1c..75f34729b 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -585,6 +585,11 @@ which can be confusing) and also added the `runme.sh` script to demonstrate it (using make was problematic). Cody notes that unfortunately this does not work 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. + ## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md])) From 353223f869243f9e910600d64a00c81b564de5d7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 10 Sep 2023 08:56:04 -0700 Subject: [PATCH 2/3] Remove address from 1992/lush/README.md --- 1992/lush/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/1992/lush/README.md b/1992/lush/README.md index 76b7e24f4..a5436cdd0 100644 --- a/1992/lush/README.md +++ b/1992/lush/README.md @@ -1,9 +1,6 @@ # Worst Abuse of the C Preprocessor Ed Luke -Mississippi State University -P.O. Box 6176 -Mississippi State, MS 39762 US From b53f584bb9356008abe52f03821b936e7a721031 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 10 Sep 2023 08:56:40 -0700 Subject: [PATCH 3/3] Minor update to 1992/lush/README.md Removed reference to original source file in the archive (this was originally added as some changes had to be made to get it to work with modern gcc - does not work with clang due to how it is programmed) as the original is lush.orig.c. There are other README.md files for other entries that have this same thing and these files will be updated in time too. --- 1992/lush/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/1992/lush/README.md b/1992/lush/README.md index a5436cdd0..eb21c56c3 100644 --- a/1992/lush/README.md +++ b/1992/lush/README.md @@ -17,8 +17,6 @@ make all ./runme.sh ``` -For the original entry see the [archive tarball](/archive/archive-1992.tar.bz2). - ## Judges' remarks: