From e9ffd327d6b1218cd0ee9b1f5020c349c19bd4c9 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 24 Nov 2023 07:38:30 -0800 Subject: [PATCH] Make 2006/sykes2 main() have two args This is out of an abundance of caution as some of the versions of clang report that main() can only have 0, 2 or 3 args to main(), not 4 or anything else. The version (clang version 17.0.4) I have encountered this with actually allows 1 arg but since clang is so picky I decided to make a second unused arg (a char **) in case the devs decide to ruin even more fun programs. There are other entries that also use one arg to main() and I will try locating those too, first with the entries I have not reviewed yet and then later on (time constraints notwithstanding) the ones I have already reviewed. Makefile updated with new -Wno- options for clang with linux. --- 2006/sykes2/Makefile | 3 ++- 2006/sykes2/sykes2.c | 2 +- thanks-for-fixes.md | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/2006/sykes2/Makefile b/2006/sykes2/Makefile index d1978f855..847a905fb 100644 --- a/2006/sykes2/Makefile +++ b/2006/sykes2/Makefile @@ -40,7 +40,8 @@ include ../../var.mk # CSILENCE= -Wno-bitwise-op-parentheses -Wno-char-subscripts -Wno-error \ -Wno-implicit-function-declaration -Wno-implicit-int -Wno-main \ - -Wno-pedantic -Wno-deprecated-non-prototype + -Wno-pedantic -Wno-deprecated-non-prototype -Wno-unused-parameter \ + -Wno-parentheses # Common C compiler warning flags # diff --git a/2006/sykes2/sykes2.c b/2006/sykes2/sykes2.c index 2e2ccaf1f..96cba09e6 100644 --- a/2006/sykes2/sykes2.c +++ b/2006/sykes2/sykes2.c @@ -1 +1 @@ -main(_){_^448&&main(-~_);putchar(--_%64?32|-~7[__TIME__-_/8%8][">'txiZ^(~z?"-48]>>";;;====~$::199"[_*2&8|_/64]/(_&2?1:8)%8&1:10);} +main(_,v)char**v;{_^448&&main(-~_,v);putchar(--_%64?32|-~7[__TIME__-_/8%8][">'txiZ^(~z?"-48]>>";;;====~$::199"[_*2&8|_/64]/(_&2?1:8)%8&1:10);} diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 53721d8f2..46661e7e4 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3030,8 +3030,12 @@ it to the repo as well. ## [2006/sykes2](2006/sykes2/sykes2.c) ([README.md](2006/sykes2/README.md])) -Cody added the [try.sh](2006/sykes2/try.sh) script for easier use of the entry -to show the clock update in real time. +Cody, out of an abundance of caution for `clang`'s defects, made `main()` have +to args instead of 1 as some versions report that `main()` must have 0, 2 or 3 +args, even though at least one of those versions allows 1 arg only. + +Cody also added the [try.sh](2006/sykes2/try.sh) script for easier use of the +entry to show the clock update in real time. ## [2006/toledo2](2006/toledo2/toledo2.c) ([README.md](2006/toledo2/README.md]))