Updates to 1989/westley

I have tried to make the README.md file less cluttered wrt the clang
defects and instead just show how to use the entry, referring to the
bugs.md for those who need to know.

Added script compile.sh which generates the files and tries to compile
them. The script sleeps (by default approximately 1 second) in between
commands but this can be changed to another value (including 0). One can
also change the compiler path in case their compiler is clang or in the
case of macOS gcc IS clang. The README.md refers to this and gives
examples.

The bugs.md and the thanks-for-fixes.md files have been updated for
these changes and additions.

For those who do not know of the clang defects it is discussed in the
bugs.md and unfortunately for this entry there might be little that can
be done. I haven't tried to understand the entry deeply and maybe doing
so would give some ideas for fixes (beyond what I already did which lets
the main program compile with clang - or at least versions that allow a
fourth arg to main()) but this seems less important for now.
This commit is contained in:
Cody Boone Ferguson committed 2023-10-07 07:10:06 -07:00
1 parent ef456bfb1e
commit 4ef3afcd74
4 files changed
+134 -29

No files matched your search

+14 -10
View File
@@ -565,9 +565,12 @@ This program will crash with numbers with non-binary digits.
Although [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for
some of the versions that are generated (see below tip) it will not work for all
with the clang compiler (gcc works fine). Cody noted that trying to fix it in
some cases causes a segfault and in other cases it fails to generate some of the
files (others are okay) at all (empty files).
with the clang compiler (gcc works fine) and in some versions of clang it will
not work at all due to yet another defect (see below also).
Cody noted that trying to fix it in some cases causes a segfault and in other
cases it fails to generate some of the files (others are okay) at all (empty
files).
There is another change that was thought up on 08 July 2023 which allows for
another version to be compiled with clang but it causes some of the versions to
@@ -579,19 +582,20 @@ Some versions of clang have an additional defect where in additional to forcing
the args of `main()` to be of type `int` (for first arg) and the rest to be
`char **` it also does not allow a fourth arg to main(). This in fact is part of
the change thought up on 08 July 2023: main() calls a function which has the old
types of variables. More will be done with this in time.
types of variables.
Cody gives these tips on the problem: `main()`'s second, third and fourth args
(but on fourth arg see above) are supposed to be a `char **`. This didn't use to
be the case and some compilers like gcc don't complain. `clang` however does.
Cody was able to get `main()` to be correct BUT a feature is that it uses ROT13
to decrypt the function `znva` to be main in _generated files_ (see the
[README.md](1989/westley/README.md) for details). Since that function does not
have the correct types when converted to main() it fails to compile. But as he
said changing the type causes either a segfault or files not generated at all.
`ver1`, `ver2` and `ver3` are the problematic ones. The segfault happens when
running the main program. Cody fixed that but as noted as for the generated
files only `ver0` will compile with clang.
[README.md](1989/westley/README.md) for details).
Since that function does not have the correct types when converted to main() it
fails to compile. But as he said changing the type causes either a segfault or
files not generated at all. `ver1`, `ver2` and `ver3` are the problematic ones.
The segfault happens when running the main program. Cody fixed that but as noted
as for the generated files only `ver0` will compile with clang.
## STATUS: known bug - please help us fix