Make my 1984/decot fix look more like original
I was able to bring back some code and only had to comment out one part
and make a minor change to another another. Originally the code had:
extern int floor;
but this is not possible in modern systems so it was changed to:
extern double floor(double);
The
double (x1, y1) b;
could be brought back, changed from:
int b,
(the comma is not a typo there).
Now it looks rather more like the original.
The thanks-for-fixes.md file was updated here, including a diff to try
(to see what had to be done to fix the entry for modern systems) but I'm
afraid it has a minor change in another entry, something I accidentally
left out of 1984/mullender.
This commit is contained in:
1 parent
5c735bce57
commit
25beceda98
2 files changed
+24
-3
No files matched your search
+5
-1
@@ -3,7 +3,11 @@
|
||||
#define char k['a']
|
||||
#define union static struct
|
||||
|
||||
int b,
|
||||
extern double floor(double);
|
||||
double (x1, y1) b;
|
||||
/*char x {sizeof(
|
||||
double(%s,%D)(*)()) */
|
||||
int
|
||||
k['a'] = {sizeof(
|
||||
int(*)())
|
||||
,};
|
||||
|
||||
+19
-2
@@ -115,9 +115,26 @@ A note about the fix is that the `#define`d macros that were used still exist
|
||||
but are not used; they are left in just to make it look more like the original
|
||||
entry. Nevertheless they cannot be used.
|
||||
|
||||
Later on Cody improved the fix to make it look rather more like the original by
|
||||
bringing back an extern declaration (slightly changing it to match the symbol
|
||||
that it is i.e. `extern double floor(double);` instead of `extern int floor;`)
|
||||
and `double (x1, y1) b;`, commenting out only the code:
|
||||
|
||||
```c
|
||||
char x {sizeof(
|
||||
double(%s,%D)(*)())
|
||||
```
|
||||
|
||||
and changing the type of `k` to be an `int`.
|
||||
|
||||
Originally Yusuke supplied a patch so that this entry would compile with gcc -
|
||||
but not clang - or at least some versions.
|
||||
|
||||
To see the difference from start to fixed:
|
||||
|
||||
```sh
|
||||
diff 1984/decot/decot.orig.c 1984/decot/decot.c
|
||||
```
|
||||
|
||||
## [1984/mullender](1984/mullender/mullender.c) ([README.md](1984/mullender/README.md]))
|
||||
|
||||
@@ -127,8 +144,8 @@ the [FAQ](faq.md) as there are some winning entries that also let one enjoy it -
|
||||
with more to them of course!
|
||||
|
||||
Cody also added the [gentab.c](1984/mullender/gentab.c) file, fixed to compile
|
||||
with modern systems and so that it would create the proper array (it had
|
||||
unbalanced '}'s), which the author noted in their remarks (which Cody also
|
||||
and work with modern systems and so that it would create the proper array (it
|
||||
had unbalanced '}'s), which the author noted in their remarks (which Cody also
|
||||
found). As this file uses the old header file `a.out.h` that is not available in
|
||||
all modern systems, Cody found a copy of it as to what it should have been at
|
||||
the time, in the fabulous [Unix History
|
||||
|
||||
Reference in new issue
Block a user