Fix 1984/decot to not require -traditional-cpp

This was fun to fix. What prompted me to do so is that I noticed that
the patch from Yusuke Endoh actually doesn't work in fedora linux. It never
worked with clang as it required -traditional-cpp and also had
non-standard second and third args type to main (not a char ** but
implicit int). No more. This entry now works with both linux and macOS!

I was able to remove all the macros as they were problematic and not
needed. The code that used them was updated to be what was necessary.

Add to Makefile inclusion of stdio.h and math.h (printf, floor).
Some systems require -lm so that was also added to the Makefile.

Very little else was required to make it work.

The decot.alt.c is the version patched by Yusuke but fixed by me to
compile with fedora's gcc.

Removed this entry from bugs.md.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-04 06:11:38 -07:00
1 parent 7832ef5e46
commit 606e01cb78
5 files changed
+97 -56

No files matched your search

+13 -17
View File
@@ -1,30 +1,26 @@
#define x =
#define double(a,b) int
#define char k['a']
#define union static struct
double (x1, y1) b,
char x {sizeof(
double(%s,%D)(*)())
int b,
k['a'] = {sizeof(
int(*)())
,};
struct tag{int x0,*xO;}
struct tag{int x0,*xO;};
*main(i, dup, signal) {
int dup, signal;
*main(int i) {
{
for(signal=0;*k *x * __FILE__ *i;) do {
(printf(&*"'\",x); /*\n\\", (*((double(tag,u)(*)())&floor))(i)));
for(signal=0;*k *= * __FILE__ *i;) do {
(printf(&*"'\",x); /*\n\\", (*((int(*)())&floor))(i)));
goto _0;
_O: while (!(char <<x - dup)) { /*/*\*/
union tag u x{4};
_O: while (!(k['a'] <<= - dup)) { /*/*\*/
static struct tag u = {4};
}
}
while(b x 3, i); {
char x b,i;
while(b = 3, i); {
k['a'] = b,i;
_0:if(b&&(int)k+
sin(signal) / * ((main) (b)-> xO));/*}
sin(signal) / * ((main) (((struct tag *)b)-> xO)));/*}
;
}