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.
This commit is contained in:
Cody Boone Ferguson committed 2023-10-07 07:42:54 -07:00
1 parent 80844970c6
commit 8dc6e39fda
3 files changed
+74 -5

No files matched your search

+1 -1
View File
@@ -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
+63 -1
View File
@@ -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
+10 -3
View File
@@ -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]))