diff --git a/1986/holloway/README.md b/1986/holloway/README.md index 0ed6b1c52..398945184 100644 --- a/1986/holloway/README.md +++ b/1986/holloway/README.md @@ -10,10 +10,12 @@ USA make all -NOTE: we could not compile this entry under modern macOS but it will work -fine under linux. It likely fails to compile under macOS because its gcc is -actually just clang which is more strict about the type of the second -argument of main(). If you have gcc under macOS it might work just as well. +NOTE: Cody Boone Ferguson fixed this to compile with clang (it worked with gcc). +The problem was that clang is more strict about the type of second arg to +main(). However simply changing it to a `char **` and updating the `*s` to `**s` +caused a segfault. By adding a new variable, `char *t`, initialising it to `s` +and then using `t` instead of `s` it compiles and runs successfully under clang +and gcc. Thank you Cody for your assistance! ## Judges' comments: diff --git a/1986/holloway/holloway.c b/1986/holloway/holloway.c index e894200f0..2e438fb5a 100644 --- a/1986/holloway/holloway.c +++ b/1986/holloway/holloway.c @@ -11,7 +11,8 @@ long tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L }; int tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 }; -main(m1,s) char *s; { +main(m1,s) char **s; { + char *t = s; int a,b,c,d,o[k],n=(int)s; if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); } else switch(m1-=h){ @@ -27,7 +28,7 @@ main(m1,s) char *s; { if((b=n)>=e)for(b=g<