Improve slightly my fix to 1988/phillipps

As main() used K&R style I changed main() to use K&R. The function that
it became (to fix it), pain(), already has the same exact format of what
main() once was only named painfully. Since main() also had the function
on many lines, even just the return statement in the beginning, I did
this in main() but given that main() only calls pain() obviously this is
not perfect. This has been documented in the thanks file like for all
the other improvements, to keep track of it.

Format/typo check README.md.
This commit is contained in:
Cody Boone Ferguson committed 2023-10-18 09:03:04 -07:00
1 parent f5d658b9b6
commit b400fc22fb
3 files changed
+19 -9

No files matched your search

+2 -7
View File
@@ -1,12 +1,7 @@
# Least likely to compile successfully
Ian Phillipps
Cambridge Consultants Ltd
Science Park
Milton Road
Cambridge CB4 4DW
England
Ian Phillipps<br>
UK
## To build:
+10 -1
View File
@@ -51,4 +51,13 @@ pain(0,
pain(-61,*a, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry")
,a+1);}
main(int t,char **_,char **a){return pain(t,(int)_,(char *)a);}
main(t,_,a )
char
**
_,
**
a;
{
return
pain(t,(int)_,
(char *)a);}
+7 -1
View File
@@ -421,7 +421,13 @@ that with gcc it printed random characters.
After fixing it for clang by changing `main()` to call the new function `pain()`
(chosen because it's a pain that clang requires these args to be `char **` :-) )
with the correct args it now works.
with the correct args it now works with gcc and clang.
Later Cody improved the fix to make it look a bit more like the original, using
K&R style functions, and trying to match the format as best as possible of what
`main()` used to look like but without the full body that cannot exist as it
once did. The format of `pain()` is exactly like how `main()` was as it's the
same code.
## [1988/reddy](1988/reddy/reddy.c) ([README.md](1988/reddy/README.md))