From 0be0511329619366372a2c06372a221a2e9e692d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 25 Nov 2023 06:46:33 -0800 Subject: [PATCH] Make 1992/kivinen main() have 2 args, not 1 Due to a clang defect. --- 1992/kivinen/Makefile | 3 ++- 1992/kivinen/kivinen.alt.c | 2 +- 1992/kivinen/kivinen.c | 2 +- thanks-for-fixes.md | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/1992/kivinen/Makefile b/1992/kivinen/Makefile index 8d29bf238..bc8d8afc5 100644 --- a/1992/kivinen/Makefile +++ b/1992/kivinen/Makefile @@ -39,7 +39,8 @@ include ../../var.mk # Common C compiler warnings to silence # CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ - -Wno-logical-op-parentheses -Wno-main -Wno-variadic-macros -Wno-deprecated-non-prototype + -Wno-logical-op-parentheses -Wno-main -Wno-variadic-macros -Wno-deprecated-non-prototype \ + -Wno-unused-parameter # Common C compiler warning flags # diff --git a/1992/kivinen/kivinen.alt.c b/1992/kivinen/kivinen.alt.c index abb713dcd..5a6986ffd 100644 --- a/1992/kivinen/kivinen.alt.c +++ b/1992/kivinen/kivinen.alt.c @@ -11,7 +11,7 @@ # define R BlackPixel(d,D) # define S r.xvisibility - int main(a)int a;{Window s[53];int w,u,i,c,y,l=0 + int main(a,b)int a;char**b;{Window s[53];int w,u,i,c,y,l=0 ,q,e=32,t,k,j=~0,z=(a+1)/2,x=a&1,v=z&1;XEvent r;Display* d=XOpenDisplay("");s[0]=A(d,DefaultRootWindow(d),200,200,(x& v?330:120)*z,215*z,2,R,R);I(N(c=0),_);for(;c<(x?32:52);c++){s[ diff --git a/1992/kivinen/kivinen.c b/1992/kivinen/kivinen.c index 562a85ea6..363057298 100644 --- a/1992/kivinen/kivinen.c +++ b/1992/kivinen/kivinen.c @@ -11,7 +11,7 @@ # define R BlackPixel(d,D) # define S r.xvisibility - int main(a)int a;{Window s[53];int w,u,i,c,y,l=0 + int main(a,b)int a;char**b;{Window s[53];int w,u,i,c,y,l=0 ,q,e=32,t,k,j=~0,z=(a+1)/2,x=a&1,v=z&1;XEvent r;Display* d=XOpenDisplay("");s[0]=A(d,DefaultRootWindow(d),200,200,(x& v?330:120)*z,215*z,2,R,R);I(N(c=0),_);for(;c<(x?32:52);c++){s[ diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 0ff9bb917..b2855c3f2 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1467,6 +1467,12 @@ line lengths match the original code, at least as best as possible (if not perfectly), including start and end columns, often (if not all) with the same start and end character. +Cody made `main()` have two args, not one, as some versions of clang have a +defect with the number of args to `main()` though when it comes to 1 arg it is +only in an error message if say 4 args are used. This is out of an abundance of +caution as it's quite possible that clang or the ANSI C committee end up further +changing this. + Yusuke also noted that there is a bug in the program where right after starting it moves towards the right but if you click the mouse it goes back.