diff --git a/1985/applin/Makefile b/1985/applin/Makefile index 1c001b094..d0f1abe41 100644 --- a/1985/applin/Makefile +++ b/1985/applin/Makefile @@ -61,7 +61,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= +CINCLUDE= -include unistd.h # Optimization # diff --git a/1985/applin/README.md b/1985/applin/README.md index b535a2c5a..0715ec3ca 100644 --- a/1985/applin/README.md +++ b/1985/applin/README.md @@ -16,9 +16,14 @@ make all ``` NOTE: [Yusuke Endoh](/winners.html#Yusuke_Endoh) provided a patch to get this to -not issue a bus error. Thank you Yusuke! [Cody Boone -Ferguson](/winners.html#Cody_Boone_Ferguson) noted that this entry does not work -under macOS. Try it out and see for yourself what happens! +not issue crash and [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) +fixed this to work with macOS. The problem with the crash is that it +destructively rewrites string literals but with `strdup()` it's safe. For macOS +it's because there was no prototype for `execlp()` and macOS has problems with +missing prototypes for some functions (this was also seen when Cody fixed +[1984/anonymous](/1984/anonymous/anonymous.c) for macOS as well though that fix +was more complicated). Ironically this fix was discovered through linux! Thank +you Yusuke and Cody for your help! ## Judges' remarks: diff --git a/bugs.md b/bugs.md index 57e648f3c..3284e7ee1 100644 --- a/bugs.md +++ b/bugs.md @@ -84,8 +84,9 @@ resolving these issues and has fixed many but you're welcome to have a go at it too (though he'll be very sad if he doesn't have a chance to at first fix it :-( so you might want to hold off for now :-) .. or not :-) ). He hopes to have most of the remaining entries resolved in the near future but nevertheless if you're -okay making people very sad you may have a go at the entries :-) He'll remove -this part later on. +okay making people very sad you may have a go at the entries :-) [Yusuke +Endoh](/winners.html#Yusuke_Endoh) has also fixed a number of entries though at +this point he does not know it. :-) Cody will remove this part later on. ## General notes about the statuses and making fixes @@ -112,9 +113,24 @@ segfault in macOS of [1989/paul](1994/paul/paul.c): changing the `int *` to a But even if they are fixable (which will likely be hard to do) it's almost certain that such code would be just as non-portable (importable ? :-) ). +In rare cases they are valid. For instance Cody noticed in linux the following +warning in [1985/applin](1985/applin/applin.c) with gcc: + +``` +applin.c:1:78: warning: incompatible implicit declaration of built-in function 'execlp' [-Wbuiltin-declaration-mismatch] + 1 | main(v,c)char**c;{for(v[c++]=strdup("Hello, world!\n");(!!c)[*c]&&(v--||--c&&execlp(*c,*c,c[!!c]+!!c,!c));**c=!c)write(!!*c,*c,!!**c);} + | ^~~~~~ +``` + +and this reminded him of his fix to +[1984/anonymous](1984/anonymous/anonymous.c). In the case of `1984/anonymous` it +was a bit more involved but with `1985/applin` one need only add to the Makefile +`-include unistd.h`. So there are some cases where fixing warnings can fix a +problem but in general they should be ignored even if they're annoying. + Hopefully with the example entries listed above you get the idea. -### General request on original code +### General request on original code: If you're fixing an entry please make as few changes as possible! This is to make it as close to the original but allowing it to work. This might be less of @@ -363,17 +379,6 @@ arg. # 1985 -## [1985/applin](1985/applin/applin.c) ([README.md](1985/applin/README.md) -## STATUS: doesn't work with some platforms - please help us fix - -[Yusuke Endoh](/winners.html#Yusuke_Endoh) provided a fix for gcc but -[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) observed that this does -not work under macOS. It prints `H????????` with additional `?`s printed as it -continues to run. - -We have not had a chance to try and fix this yet but you're welcome to have a go -at it. - # 1986