Improve my fixes to 1984/decot
To make it look more like the original but to still work with compilers without -traditional-cpp (which clang does not support) and other defects with clang (including one that was problematic in linux but not macOS) code that used macros had to be modified and used directly. But I removed the macros because of this. Now they are added back even though they are unused, just to give it a more authentic, original look. The thanks-for-fixes.md file was updated for this, both formatting and otherwise, but an unfortunate thing is that another entry was also modified in there. This is because I was aiming to just do format fixes in 1984 in one pull request to save time but then I came across this and decided to fix it and this should be in a single pull request. Something I noticed is that the fix for linux clang _appears_ to not be needed at least with clang 16.0.6 but what the difference is is just extra warnings. I cannot imagine I changed it just for that so I have left that change in in case there was a problem in earlier versions or something else I do not recall. It should be noted that without the change at least with clang 16.0.6 it appears to work just fine. It is unclear if it should be changed back but again as I can't imagine that I would have changed it just for warnings I think it's wiser not to.
This commit is contained in:
1 parent
c19a19923f
commit
aae8bf1b83
3 files changed
+42
-27
No files matched your search
@@ -1,7 +1,6 @@
|
||||
# Second place award
|
||||
|
||||
Dave Decot
|
||||
|
||||
Dave Decot
|
||||
|
||||
## To build:
|
||||
|
||||
@@ -9,14 +8,12 @@ Dave Decot
|
||||
make all
|
||||
```
|
||||
|
||||
|
||||
## To run:
|
||||
|
||||
```sh
|
||||
./decot
|
||||
```
|
||||
|
||||
|
||||
### Alternate code:
|
||||
|
||||
To try the original code that requires `-traditional-cpp`:
|
||||
@@ -26,7 +23,6 @@ make alt
|
||||
./decot.alt
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
This program prints out a string of garbage.
|
||||
@@ -36,8 +32,8 @@ The judges also offer this one comment: understand remarks!
|
||||
|
||||
### Historical remarks:
|
||||
|
||||
Some new (in 1984) compilers disliked line 15 of the original source, so we changed it
|
||||
from:
|
||||
Some new (in 1984) compilers disliked line 15 of the original source, so we
|
||||
changed it from:
|
||||
|
||||
```c
|
||||
for(signal=0;*k * x * __FILE__ *i;) do {
|
||||
@@ -49,7 +45,6 @@ to:
|
||||
for(signal=0;*k *x * __FILE__ *i;) do {
|
||||
```
|
||||
|
||||
|
||||
To see what we mean look at the [original source file](decot.orig.c).
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#define x =
|
||||
#define double(a,b) int
|
||||
#define char k['a']
|
||||
#define union static struct
|
||||
|
||||
int b,
|
||||
k['a'] = {sizeof(
|
||||
int(*)())
|
||||
|
||||
Reference in new issue
Block a user