move fix thanks a file, update top level html links, rename CONTRIBUTING.md
The fix thank you's have been moved from `README.md` to `thanks-for-fixes.md`. **WARNING**: Some mistakes may have been made in doing this. We presume later changes by others will correct any issues. The `CONTRIBUTING.md` was renamed `how-to-enter.md`. A 3rd line of links was added to top level html such as `contact.html`, `index.html`, `judges.html`, `winners.html`, and `years.html`. Improved blank line use in a number (but not all) `README.md` files.
This commit is contained in:
1 parent
23f7ac0a49
commit
ac41f07a83
92 files changed
+1326
-761
No files matched your search
+11
-15
@@ -5,12 +5,14 @@ Greece
|
||||
<https://www.spinellis.gr/>
|
||||
Mastodon: <https://mstdn.social/@DSpinellis>
|
||||
|
||||
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make all
|
||||
```
|
||||
|
||||
|
||||
## To run:
|
||||
|
||||
```sh
|
||||
@@ -18,18 +20,10 @@ make all
|
||||
./a.out 2>/dev/null
|
||||
```
|
||||
|
||||
|
||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault that
|
||||
prevented this entry from working at all and made an alternate version
|
||||
that works with `clang`. The alternate code, described below, is what is needed
|
||||
for clang. Reading it might be instructive even if you have gcc.
|
||||
|
||||
The segfault which was always triggered was due to the code `*q>' '&&(*q)--;`.
|
||||
This seems odd at first glance but it's pointing to `s` which was read-only
|
||||
memory as a `char *s`. It's now a `char s[]`.
|
||||
|
||||
Thank you Cody for your assistance!
|
||||
|
||||
|
||||
NOTE: for `clang` you'll likely have to use the alternate code described below.
|
||||
|
||||
@@ -42,6 +36,7 @@ something funny.
|
||||
These are a mild nuisance but are considered a feature not a bug. We challenge
|
||||
you to fix it for learning if you wish. See also [bugs.md](/bugs.md).
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
With gcc, make and run as follows:
|
||||
@@ -66,13 +61,15 @@ What happens if you give the program a C program like itself? Try:
|
||||
You'll get errors yes but what does the generated file look like? What about
|
||||
other types of files?
|
||||
|
||||
|
||||
### Alternative code:
|
||||
|
||||
The alternative code, provided by Cody, allows this entry to work successfully
|
||||
|
||||
The alternative code allows this entry to work successfully
|
||||
even with clang. He notes that unfortunately it's something of a hack or maybe
|
||||
even a kludge. This however seems important because it works well and allows for
|
||||
not messing with the `s` string which is quite complicated. For all Cody knows
|
||||
even changing the length could break functionality and indeed the length would
|
||||
not messing with the `s` string which is quite complicated.
|
||||
Even changing the length could break functionality and indeed the length would
|
||||
have to be longer for this to work with clang.
|
||||
|
||||
How does it work? The code (which you will see in [dds.c](dds.c)) does a `return
|
||||
@@ -83,8 +80,8 @@ that the compilation failed with clang (because it didn't use `make` so no
|
||||
[LANDER.BAS](LANDER.BAS)) due to a return from `main()` without a return value
|
||||
and the use of functions not yet declared.
|
||||
|
||||
Now as noted since the string `s` is complicated and because Cody did not want
|
||||
to inadvertently mess something up he changed that code to `system("make a");`
|
||||
Now as noted since the string `s` is complicated and to not
|
||||
inadvertently mess something up he changed that code to `system("make a");`
|
||||
and then added the right rule to the Makefile. Thus for the alternative version
|
||||
you now need both `make` and `cc`. If you use gcc you may change the system()
|
||||
call to what was given in this description to get a more authentic feel. If you
|
||||
@@ -97,8 +94,6 @@ make clobber alt
|
||||
./a 2>/dev/null
|
||||
```
|
||||
|
||||
Thank you Cody for your assistance!
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
@@ -170,6 +165,7 @@ decision tree is implemented in order to match the statements. (Of
|
||||
course the `s` string is encoded by adding one to every character of it just
|
||||
to confuse you).
|
||||
|
||||
|
||||
## Copyright and CC BY-SA 4.0 License:
|
||||
|
||||
This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
Reference in new issue
Block a user