From 4e736301ad03b5627dc4ff179f30314416e8817d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 25 Nov 2023 11:10:45 -0800 Subject: [PATCH] Add second arg to main in 2004/kopczynski --- 2004/kopczynski/kopczynski.c | 2 +- thanks-for-fixes.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/2004/kopczynski/kopczynski.c b/2004/kopczynski/kopczynski.c index d18e60a23..ea5e5e7ac 100644 --- a/2004/kopczynski/kopczynski.c +++ b/2004/kopczynski/kopczynski.c @@ -1 +1 @@ -main(O){int I,Q,l=O;if(I=l*4){l=6;if(l>5)l+=Q-8?l-(Q=getchar()-2)%2:l;if(Q*=2)O+="has dirtiest IF"[(I/-Q&12)-l/Q%4];}printf("%d\n",8+O%4);} +main(O,S)char**S;{int I,Q,l=O;if(I=l*4){l=6;if(l>5)l+=Q-8?l-(Q=getchar()-2)%2:l;if(Q*=2)O+="has dirtiest IF"[(I/-Q&12)-l/Q%4];}printf("%d\n",8+O%4);} diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 65f5c8bff..4e30adec0 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2750,6 +2750,10 @@ Finally Cody added [try.sh](2004/jdalbec/try.sh) and Cody reported that this entry cannot be optimised by the compiler as otherwise it will not work. +Cody, out of an abundance of caution for clang, added a second arg to `main()` +as some versions complain about the number of args and although they accept 1 it +is entirely possible it will eventually be that they don't. + Cody also added the [try.sh](2004/kopczynski/try.sh) script and various data files: [kopczynski-a](kopczynski-a) to demonstrate what happens when art more like a letter is fed to the program and the `kopczynski*-rev` files which are