From a875bde4d0895656fa49d4fb7efe6c0f1b2c1792 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:20:34 -0700 Subject: [PATCH 01/13] Fix 2004/jdalbec for gcc GCC objected to the '##' and some other cpp directives that were being used. This unfortunately did mess up the formatting of the some of the code but I tried to preserve the art and the periodic table of elements formatting (this was preserved but whether I got all the art or not preserved I do not know) as these parts seemed too important to not preserve. --- 2004/jdalbec/jdalbec.c | 283 ++++++++++++++++++----------------------- thanks-for-fixes.md | 26 ++++ 2 files changed, 152 insertions(+), 157 deletions(-) diff --git a/2004/jdalbec/jdalbec.c b/2004/jdalbec/jdalbec.c index 2776d2d37..073a39c4d 100644 --- a/2004/jdalbec/jdalbec.c +++ b/2004/jdalbec/jdalbec.c @@ -1,28 +1,25 @@ -#define Nd Np define -#define Np ??= - -Nd Ba BC(B, I) -Nd Be BC(Br, I) -Nd Ca(C, Ca) CB(B, In C, Ca) -Nd Cl(Cl) Cl Cl -Nd Cs const -Nd FrB N = Zr; Fr((O, B = BrB(BrF, I))) -Nd Fe(F) FO (In = Zr; F; In++) -Nd FF FB(B); FB(BF); -Nd FI Fe(IO) -Nd FO for -Nd Fr(F) FO (I = Zr; F; I++) -Nd II I I, In -Nd In(I, Ir) main(I, Ir) -Nd IO In[O[C + I]] -Nd Ir(I) if (I) -Nd Nb N > N && N > -O -Nd Rb(Rb, B) BBr(Br, Rb, B) -Nd Re return -Nd Sc struct -Nd Si(Te) sizeof (Te) -Nd Te typedef -Nd Zn N < Zr +??= define Ba BC(B, I) +??= define Be BC(Br, I) +??= define Ca(C, Ca) CB(B, In C, Ca) +??= define Cl(Cl) Cl Cl +??= define Cs const +??= define FrB N = Zr; Fr((O, B = BrB(BrF, I))) +??= define Fe(F) FO (In = Zr; F; In++) +??= define FF FB(B); FB(BF); +??= define FI Fe(IO) +??= define FO for +??= define Fr(F) FO (I = Zr; F; I++) +??= define II I I, In +??= define In(I, Ir) main(I, Ir) +??= define IO In[O[C + I]] +??= define Ir(I) if (I) +??= define Nb N > N && N > -O +??= define Rb(Rb, B) BBr(Br, Rb, B) +??= define Re return +??= define Sc struct +??= define Si(Te) sizeof (Te) +??= define Te typedef +??= define Zn N < Zr Te char C; Te int I; @@ -54,37 +51,7 @@ V *(*Mo)(Si) = malloc; I (*Pr)(Cs C *, ...) = printf; I (*P)(I) = putchar; -Nd Tm(B,C) \ -Sc B { \ - C *B; \ - I N; \ -} ; \ -Te Sc B *B; \ -\ -B N##B (I) ; \ -V F##B (B) ; \ -C B##C (B, I) ; \ -V C##B (B, I, C) ; \ -\ -B N##B (I N) { \ - B B; \ -\ - Re (W, B = Mo(Si(Sc B))) ? \ - (O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? \ - B Cl(: (At(), B)); \ -} \ -V F##B (B B) { \ - F(B->B); \ - F(B); \ -} \ -C B##C (B B, I N) { \ - Re B->Nb ? B->B[N] : (C) Zr; \ -} \ -V C##B (B B, I N, C C) { \ - N; \ - B->Nb ? B->B[N] = C : C ? At(), C : C; \ -} - +??= define Tm(B,C) Sc B { C *B; I N; } ; Te Sc B *B; B N##B (I) ; V F##B (B) ; C B##C (B, I) ; V C##B (B, I, C) ; B N##B (I N) { B B; Re (W, B = Mo(Si(Sc B))) ? (O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? B Cl(: (At(), B)); } V F##B (B B) { F(B->B); F(B); } C B##C (B B, I N) { Re B->Nb ? B->B[N] : (C) Zr; } V C##B (B B, I N, C C) { N; B->Nb ? B->B[N] = C : C ? At(), C : C; } Tm(B,C) V Pb (B) ; @@ -93,30 +60,30 @@ C Co (B, B, I) ; B Sb (B, I) ; V Pb (B B) { - I I; - Fr(Ba) - P(Ba); + I I; + Fr(Ba) + P(Ba); } I Bi (B B) { - I I; - Fr(Ba) ; - Re I; + I I; + Fr(Ba) ; + Re I; } C Co (B Br, B B, I N) { - I I; - Fr(I < N) - Ir(Be - Ba) - Re Be - Ba; - Re Zr; + I I; + Fr(I < N) + Ir(Be - Ba) + Re Be - Ba; + Re Zr; } B Sb (B Br, I N) { - B B; - I I; + B B; + I I; - B = NB(Zn ? Bi(Br) + N : N); - FO(I = Zn ? -N : Zr; Zn ? Be : I < N; I++) - CB(B, Zn ? I + N : I, Be); - Re B; + B = NB(Zn ? Bi(Br) + N : N); + FO(I = Zn ? -N : Zr; Zn ? Be : I < N; I++) + CB(B, Zn ? I + N : I, Be); + Re B; } Tm(Br,B) @@ -124,13 +91,13 @@ Tm(Br,B) V PBr (Br, I) ; V PBr (Br B, I N) { - I I; - Pr(W * W + Xe, N); - Fr(BrB(B, I)) { - P(O[Na]); - Pb(BrB(B, I)); - } - P(Xe[W << W]); + I I; + Pr(W * W + Xe, N); + Fr(BrB(B, I)) { + P(O[Na]); + Pb(BrB(B, I)); + } + P(Xe[W << W]); } B Dy (B, I) ; @@ -138,107 +105,109 @@ I S (C, B) ; Br Sr (Br) ; B Dy (B Br, I N) { - B B; - C C, Cr; - II; + B B; + C C, Cr; + II; - B = NB(W * Bi(Br)); - FO(In = I = Zr; (O, C = Be); I++) { - FO(Cr = O; (W, C == BC(Br, I + Cr)); Cr++) ; - I += Cr - O; - Ca(++, Cr + Si(H)**H - Si(U)**U); - Ca(++, C); - } - Ir(N) - FB(Br); - Ca(-N, W[H]); - Re B; + B = NB(W * Bi(Br)); + FO(In = I = Zr; (O, C = Be); I++) { + FO(Cr = O; (W, C == BC(Br, I + Cr)); Cr++) ; + I += Cr - O; + Ca(++, Cr + Si(H)**H - Si(U)**U); + Ca(++, C); + } + Ir(N) + FB(Br); + Ca(-N, W[H]); + Re B; } I S (C C, B Br) { - B B, BF; - II; + B B, BF; + II; - Ir(C == BC(Br, Zr)) - Re Zr; + Ir(C == BC(Br, Zr)) + Re Zr; - Fr(Be) { - B = Cl(BF = Sb(Br, I); ) + Fr(Be) { + B = Cl(BF = Sb(Br, I); ) - Fe(BC(B, Zr)) { - B = Dy(B, W); - Ir(C == BC(B, Zr)) { - FF - Re Zr; - } + Fe(BC(B, Zr)) { + B = Dy(B, W); + Ir(C == BC(B, Zr)) { + FF + Re Zr; + } - Ir(In % W) - BF = Dy(BF, W); + Ir(In % W) + BF = Dy(BF, W); - Ir(Zr == Co(B, BF, Bi(BF))) { - FF - Re O; - } - } + Ir(Zr == Co(B, BF, Bi(BF))) { + FF + Re O; + } + } - FF - } - B = Dy(Br, Zr); - I = S(C, B); - FB(B); - Re I; + FF + } + B = Dy(Br, Zr); + I = S(C, B); + FB(B); + Re I; } Br Sr (Br BrF) { - Br Br; - B B, BF; - II, N; + Br Br; + B B, BF; + II, N; - FrB - N += Bi(B); - Br = NBr(N); - FrB { - Rb(N++, B); - Fe(BC(B, In + O)) - S(BC(B, In), BF = Sb(B, -In - O)) ? - Ca(+O, O[U]), - Rb(N++, B = BF), - In = Zr : - (FB(BF), W); - } - FBr(BrF); - Rb(N, (V *) Zr); - Re Br; + FrB + N += Bi(B); + Br = NBr(N); + FrB { + Rb(N++, B); + Fe(BC(B, In + O)) + S(BC(B, In), BF = Sb(B, -In - O)) ? + Ca(+O, O[U]), + Rb(N++, B = BF), + In = Zr : + (FB(BF), W); + } + FBr(BrF); + Rb(N, (V *) Zr); + Re Br; } I In (I, C **) ; I In (I N, C ** C) { - Br Br; - B B; - II; + Br Br; + B B; + II; - Br = NBr(--N); - Fr(I < N) { - FI ; - Rb(I, B = NB(In)); - FI - Ca(-Zr, IO); - } + Br = NBr(--N); + Fr(I < N) { + FI ; + Rb(I, B = NB(In)); + FI + Ca(-Zr, IO); + } - Fr(BrB(Br, Zr)) { - Br = Sr(Br); - PBr(Br, I); + Fr(BrB(Br, Zr)) { + Br = Sr(Br); + PBr(Br, I); + + Fe((W, B = BrB(Br, In))) { + Rb(In, Dy(B, Zr)); + FB(B); + } + } - Fe((W, B = BrB(Br, In))) { - Rb(In, Dy(B, Zr)); - FB(B); - } - } - { } { } { } { } { } { } { } { } { } { } { } { } { { } } { } { } { } { } { } { } { } { } { { } } { { } } { } { } { } { } { } { } { { } } { } { } { { } } C; { } { { } } { } { } { } { } { } { } { } { } { { } } { } { } { } { } { } { } { } { } { } { } { } - Re Zr; + + + Re Zr; } diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index a12d4c878..b5f376d17 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1001,6 +1001,32 @@ provided, found under the [img/](2004/gavin/img/) directory. Note that the done this way to prevent extraction from the entry directory overwriting the files and causing `make clobber` to wipe some of them out. +## [2004/jdalbec](2004/jdalbec/jdalbec.c) ([README.md](2004/jdalbec/README.md)) + +Cody fixed this to compile with gcc (it worked with clang). The problem was the +cpp being unable to parse the generated code (see the README.md for details) and +this ended up with a number of errors like: + + +```c +jdalbec.c:64:5: error: stray '##' in program + 64 | B N##B (I) ; \ + | ^~ + + +.. + +jdalbec.c:65:5: error: stray '##' in program + 65 | V F##B (B) ; \ + | ^~ +jdalbec.c:65:5: error: expected ';' before 'B' + 65 | V F##B (B) ; \ + | ^ ~ + | ; +``` + +and various other problems. + ## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md])) From 04f6af3952549924d0aa8b8ed8bed851ebfe4ec8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:39:11 -0700 Subject: [PATCH 02/13] Add -lm to 2015/yang/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2015/yang/Makefile | 2 +- thanks-for-fixes.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/2015/yang/Makefile b/2015/yang/Makefile index 4f5d37bbe..e35e6b12e 100644 --- a/2015/yang/Makefile +++ b/2015/yang/Makefile @@ -74,7 +74,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= +LIBS= -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index b5f376d17..281ef0d93 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1311,6 +1311,8 @@ time. Cody fixed an unfortunate typo in the Makefile that was preventing some of the files from compiling properly, trying instead to compile already compiled code. +He also added explicit linking of libm (`-lm`) for systems that do not do this +(linux seems to not but macOS does). ## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md])) From 8e1112bea08a09f61c211147fedfb08cba6851ac Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:41:29 -0700 Subject: [PATCH 03/13] Add -lm to 2018/bellard/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2018/bellard/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2018/bellard/Makefile b/2018/bellard/Makefile index 130523bc5..3883c6d99 100644 --- a/2018/bellard/Makefile +++ b/2018/bellard/Makefile @@ -75,7 +75,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= -lcurses +LIBS= -lcurses -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 281ef0d93..3649d38c7 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1314,6 +1314,11 @@ files from compiling properly, trying instead to compile already compiled code. He also added explicit linking of libm (`-lm`) for systems that do not do this (linux seems to not but macOS does). +## [2018/bellard](2018/bellard/prog.c) ([README.md](2018/bellard/README.md)) + +Cody added explicit linking of libm (`-lm`) for systems that do not do this +(linux doesn't seem to but macOS does). + ## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md])) From 8e618941fcff7fa329076399c0561471e6d8661b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:42:57 -0700 Subject: [PATCH 04/13] Add -lm to 2018/hou/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2018/hou/Makefile | 2 +- thanks-for-fixes.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/2018/hou/Makefile b/2018/hou/Makefile index a0909d687..3e66d61fc 100644 --- a/2018/hou/Makefile +++ b/2018/hou/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= +LIBS= -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 3649d38c7..2f93ccc6d 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1319,6 +1319,12 @@ He also added explicit linking of libm (`-lm`) for systems that do not do this Cody added explicit linking of libm (`-lm`) for systems that do not do this (linux doesn't seem to but macOS does). +## [2018/hou](2018/hou/prog.c) ([README.md](2018/hou/README.md)) + +Cody added explicit linking of libm (`-lm`) for systems that do not do this +(linux doesn't seem to but macOS does). + + ## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md])) From d37f6e1fbbdb52b170e61e82c845b944a7c38aaa Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:47:06 -0700 Subject: [PATCH 05/13] Add -lm to 2019/dogon/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2019/dogon/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2019/dogon/Makefile b/2019/dogon/Makefile index e021c530d..2ec91e0a7 100644 --- a/2019/dogon/Makefile +++ b/2019/dogon/Makefile @@ -76,7 +76,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= -L ${X11_LIBDIR} -lX11 +LIBS= -L ${X11_LIBDIR} -lX11 -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 2f93ccc6d..b55851102 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1349,6 +1349,11 @@ Cody made the author's statement that the entry compiles cleanly true by fixing versions of C` (in main()). Not strictly necessary but if he's making fixes he might as well. +## [2019/dogon](2019/dogon/prog.c) ([README.md](2019/dogon/README.md)) + +Cody added explicit linking of libm (`-lm`) for systems that do not do this +(linux does not seem to but macOS does). + ## [2019/karns](2019/karns/prog.c) ([README.md](2019/karns/README.md])) From 98a9acf7984a117ac4774605adcf2d4953cfe3c7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:50:16 -0700 Subject: [PATCH 06/13] Add -lm to 2015/hou/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2015/hou/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2015/hou/Makefile b/2015/hou/Makefile index c0b18a6ad..86e7afbab 100644 --- a/2015/hou/Makefile +++ b/2015/hou/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= +LIBS= -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index b55851102..dae18536b 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1305,6 +1305,11 @@ that there are others as well but we don't seem to have them and he didn't provide them on his page. We've not yet contacted him for a copy but we will in time. +## [2015/hou](2015/hou/prog.c) ([README.md](2015/hou/README.md)) + +Cody added explicit linking of libm (`-lm`) for systems that do not do this +(linux doesn't seem to but macOS does). + ## [2015/yang](2015/yang/prog.c) ([README.md](2015/yang/README.md])) From 85a15c683ca048dbb80143f3f4cc667d7387cd33 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:56:24 -0700 Subject: [PATCH 07/13] Add -lm to 2005/jetro/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2005/jetro/Makefile | 2 +- thanks-for-fixes.md | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/2005/jetro/Makefile b/2005/jetro/Makefile index fad0824df..006131719 100644 --- a/2005/jetro/Makefile +++ b/2005/jetro/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= `${SDL2_CONFIG} --libs` +LIBS= `${SDL2_CONFIG} --libs` -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index dae18536b..0329c88d8 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1155,12 +1155,17 @@ for the self-test feature. For much more details on the problem see [bugs.md](/bugs.md). +## [2005/jetro](2005/jetro/jetro.c) ([README.md](2005/jetro/README.md)) + +Cody added explicit linking of libm (`-lm`) for systems like linux that seem to +not do it implicitly (like macOS does). + ## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md])) -Cody fixed this so that the -[configure](source/configure) script (which is not needed but part of the entry) -would work with compilers that have by default `-Werror` like clang in macOS. +Cody fixed this so that the [configure](source/configure) script (which is not +needed but part of the entry) would work with compilers that have by default +`-Werror` like clang in macOS. Cody also added the alt code which does scan for https. Futile, maybe, based on how https is set up, in which case just enjoy it for what it was. But there From 2d3c39207f76ff036d70e8c8aff914ad5a0b17c8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:59:58 -0700 Subject: [PATCH 08/13] Add -lm to 2013/morgan1/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2013/morgan1/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2013/morgan1/Makefile b/2013/morgan1/Makefile index 3cd386f13..07364fe30 100644 --- a/2013/morgan1/Makefile +++ b/2013/morgan1/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= -L ${X11_LIBDIR} -lX11 +LIBS= -L ${X11_LIBDIR} -lX11 -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 0329c88d8..7ce556a73 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1294,6 +1294,11 @@ removed from SDL2 so the Makefile has to use `sdl-config` and not `sdl2-config`. This means that to be strictly technical, the removal of `localtime()` is not necessary but this change was left in place anyway. +## [2013/morgan1](2013/morgan1/morgan1.c) ([README.md](2013/morgan1/README.md)) + +Cody added explicit linking of libm (`-lm`) as not all systems do this +implicitly (linux doesn't seem to but macOS does). + ## [2014/maffiodo1](2014/maffiodo1/maffiodo1.c) ([README.md](2014/maffiodo1/README.md])) From e05ab1c10cd50f8bdf09c4282517caa7a532b33f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:03:54 -0700 Subject: [PATCH 09/13] Add -lm to 2012/endoh1/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2012/endoh1/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2012/endoh1/Makefile b/2012/endoh1/Makefile index 8d3802f1f..5ab733a1f 100644 --- a/2012/endoh1/Makefile +++ b/2012/endoh1/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= +LIBS= -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 7ce556a73..07c91cbd1 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1256,6 +1256,11 @@ Cody, though he feels slightly sick :-), added a version for Windows based on the author's comments (along with looking up the function for the right header file). To build try the alt rule of the Makefile. +## [2012/endoh1](2012/endoh1/endoh1.c) ([README.md](2012/endoh1/README.md)) + +Cody added explicit linking of libm (`-lm`) as not all systems do this +implicitly (linux doesn't seem to but macOS does). + ## [2012/kang](2012/kang/kang.c) ([README.md](2012/kang/README.md])) From 2ae35e684771f3d5b680676c899f85c459ea3ea3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:06:45 -0700 Subject: [PATCH 10/13] Add -lm to 2012/blakely/Makefile Not all systems implicitly link in libm so this is necessary for those systems. --- 2012/blakely/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/2012/blakely/Makefile b/2012/blakely/Makefile index 4a6a17ac5..86179fc10 100644 --- a/2012/blakely/Makefile +++ b/2012/blakely/Makefile @@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} # Libraries needed to build # -LIBS= +LIBS= -lm # C compiler to use # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 07c91cbd1..59dd95e2f 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1256,6 +1256,11 @@ Cody, though he feels slightly sick :-), added a version for Windows based on the author's comments (along with looking up the function for the right header file). To build try the alt rule of the Makefile. +## [2012/blakely](2012/blakely/blakely.c) ([README.md](2012/blakely/README.md)) + +Cody added explicit linking of libm (`-lm`) as not all systems do this +implicitly (linux doesn't seem to but macOS does). + ## [2012/endoh1](2012/endoh1/endoh1.c) ([README.md](2012/endoh1/README.md)) Cody added explicit linking of libm (`-lm`) as not all systems do this From fe45336fb3f71572f8111d742c2eeb78e4dff314 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:10:34 -0700 Subject: [PATCH 11/13] Add back data files for 2012/grothe It seems it was a mistake to remove them. Running make on a system that hasn't already built the program fails due to missing files. --- 2012/grothe/.gitignore | 5 ----- 2012/grothe/cookie_piece1.dat | Bin 0 -> 1002 bytes 2012/grothe/cookie_piece2.dat | Bin 0 -> 1002 bytes 2012/grothe/cookie_piece3.dat | Bin 0 -> 1002 bytes 2012/grothe/cookie_piece4.dat | Bin 0 -> 1002 bytes 2012/grothe/cookie_recipe_restore.txt | Bin 0 -> 1002 bytes 6 files changed, 5 deletions(-) create mode 100644 2012/grothe/cookie_piece1.dat create mode 100644 2012/grothe/cookie_piece2.dat create mode 100644 2012/grothe/cookie_piece3.dat create mode 100644 2012/grothe/cookie_piece4.dat create mode 100644 2012/grothe/cookie_recipe_restore.txt diff --git a/2012/grothe/.gitignore b/2012/grothe/.gitignore index 0fc8c9617..55e10c3b7 100644 --- a/2012/grothe/.gitignore +++ b/2012/grothe/.gitignore @@ -1,8 +1,3 @@ grothe grothe.c.1 grothe.c.2 -cookie_recipe_restore.txt -cookie_piece1.dat -cookie_piece2.dat -cookie_piece3.dat -cookie_piece4.dat diff --git a/2012/grothe/cookie_piece1.dat b/2012/grothe/cookie_piece1.dat new file mode 100644 index 0000000000000000000000000000000000000000..d7a702f6cb41490ffee6048a0eedc1028f7210e7 GIT binary patch literal 1002 zcmVJq>dSSnKS5pLDyG0pcmdI4IH&#h;-I0`vtDVJ)WjJKOD92%4^) zJ*d-X16Q#h_ zAUIZ&z(}%43OdyMxVKSxwDA)uJPE=aXXKiHF6*v~D|t3Y%n`}WScQ5^F<^fCbB_9a z&oU1k9zR-Z?J2WSEx4?T7>jG5vcZO!_m?8aDeO|Ghk;qn+`dU zwYz0|jN%&UL{<<+m8^sBO#CYLT0y6wUyMg1oo}ji9bVfJ48g+3kQ|8vZ?#E@qr6?n zASW~KZvp~H;P~uSd4iaN|Ko#2`U1@r5^~$)1r~a~k za=o}4NtwOE%}e9#Bd-GXQq%m1kzCr=V-Hp@#`%c9V55R$pkTCcC^XEeh#h<7&nD0Y zM8FKrp!*du3lTs1EOfawgBN?st?*|S5A1Ez8Z5DNeQ~?8Y&$?fsvh)BZ*SHyj#BtlgY;fYMH5RjcNaD@><6( z`{FO_>Xs(Ka!>)==3#VIA!L%|Cg?8J&uN`-j4uLNne?j!tB?BeGr!FlKrLEfn_7YU(`Mr1>JU|+Onxl1SQYCL<0B~Q4j1RTxlH4GqD+6 zAc5X?MqyCRq6+7}V8X2h4QMkSGK!%I^Yb=<8W}h(yz>!X>Bz?E6cOo@^D~Qol1ZTQ YmfpoBY^gqokCn~A)_m>jI7)2so=rmhQUCw| literal 0 HcmV?d00001 diff --git a/2012/grothe/cookie_piece2.dat b/2012/grothe/cookie_piece2.dat new file mode 100644 index 0000000000000000000000000000000000000000..7c4ac5ae70d56b0ac8ee01da378ab29de34e9824 GIT binary patch literal 1002 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 Yk1WLH$?us_NI8D-Bezo#U+M8YBF@zX@&Et; literal 0 HcmV?d00001 diff --git a/2012/grothe/cookie_recipe_restore.txt b/2012/grothe/cookie_recipe_restore.txt new file mode 100644 index 0000000000000000000000000000000000000000..6445cfad21c799a8403c5f953a9bb23abd36c080 GIT binary patch literal 1002 zcmVac|mCK2wX0JO^o@w-_1!{H!%{nzAk^$0&KXsAudRwR)U;fv$?gy}i>bd?fFP!R!o-qR#B1)4il@=4#4e1UG+d2P} zqguTl1(pX8DcbrX;#A{m90-2qRqigKcnT`1Ez#JeWCOMaem!vX3@631W2B75P7YUD z;a6~U8JkmW(=%N#MAguc@5)M+Qs4Dvs^6|ylKOCu3c_-=l6ZBGmjC(C!#T<}3Ql~J zNtB3Y)c1(!NYCuCE0Yjf#7+u}h53m_UF%t7+dM%vi0hoVo?69cv4Y|XSn!&E79rG0 z`8dhzf+5Jc9xk9CGxL)6sr488qOj37NC2$)by73FZJ_+cm9C|jyBXbkE!n>1@ zba5W2i4|m+SL=Z+QSWi+z;&P1KN^|WkdQl)$Q;M>h^+k>wOY+>3r#!Zst$iOPWOFr zQYE3nJ+f%5VwGVS>aQ$wtbto|m0X{1*Kdx37f(tNr^5@O^0}$WN#{-GGSHc!Nib=9 zp(9`jAJ<2b82>aB?6|*7rsCf9xm;unBZOQ?$t3zjR32ID3TH~}5Goo+r==9(Bc0s8 zq-`U?+oQ7ubKd79`j!M0V2!p~Dr|;S%28psn5?U5Xt3ma;Y&k3oD=q7{-dgfbjF%# z3KggQk|ZwBT6A3+vCOOdOiGH=glu|1jqR-JM+}(D*)b&%c<3GG+b*n7_+Qnbi#mh2 z@56?jhPJkpNW8A@d%JJgR6ht%Gpst0AS`q9)7cIwU{|~Sm zKkE-;tmo^ztj!nb|9*TQKO>Ho_h8}PW&(i}Zk&a-zxo?#x7X{Qigdf0W>1+o7VI>m Yk1WLH$?us_NI8D-Bezo#U+M8YBF@zX@&Et; literal 0 HcmV?d00001 From b198d4e5a4458bf0ff9f18afca6bd365a0f48538 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:16:10 -0700 Subject: [PATCH 12/13] Fix 1990/stig/Makefile for linux The paths in the shell command did not have './' to it and this no longer works. I believe it did work in macOS but I no longer remember for sure. --- 1990/stig/Makefile | 2 +- thanks-for-fixes.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/1990/stig/Makefile b/1990/stig/Makefile index 6c0169965..743fac03a 100644 --- a/1990/stig/Makefile +++ b/1990/stig/Makefile @@ -127,7 +127,7 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "source stig.sh ; source stig.c" | ${SH} + @echo "source ./stig.sh ; source ./stig.c" | ${SH} # alternative executable # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 59dd95e2f..825f65f5e 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -426,6 +426,11 @@ Yusuke pointed out that `atof` nowadays needs `#include ` which was used in order to get this to work initially (prior to this output was there but incomplete). +## [1990/stig](1990/stig/stig.c) ([README.md](1990/stig/README.md)) + +Cody fixed the paths in the Makefile so that this would build in linux (it +worked fine in macOS). + ## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md])) From fa1f35a7d69cf8055e6c732d076c9e22caf99dbb Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:42:50 -0700 Subject: [PATCH 13/13] Fix 2015/endoh3 for linux There was a problem with duplicate symbols of main but using the option -fcommon in the compiler flags solves this problem. It was not an issue with macOS as the default behaviour (I guess default anyway). With this commit I believe that all entries (except for two that are not supposed to compile) compile in linux. They haven't all been tested but all but two should compile in linux if one has the appropriate libraries for those that use other libraries. --- 2015/endoh3/Makefile | 2 +- thanks-for-fixes.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/2015/endoh3/Makefile b/2015/endoh3/Makefile index cfdec289a..2f478f2f6 100644 --- a/2015/endoh3/Makefile +++ b/2015/endoh3/Makefile @@ -57,7 +57,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= +CDEFINE= -fcommon # Include files that are needed to compile # diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 825f65f5e..f14ea7cf5 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1323,6 +1323,10 @@ were linking errors. ## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md])) +Cody fixed this to compile with linux which was having a problem with duplicate +symbols of `main()`. The fix is through the option `-fcommon` which will let it +compile like it does with macOS. + The author, Yusuke, supplied the additional source files, which Cody added to the repo for us. Yusuke wrote in his [analysis of the entry](https://mame-github-io.translate.goog/ioccc-ja-spoilers/2015/endoh3.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)