It turns out I did not need to add a prototype to read() prior to
main(); all that needed to be done is to specify the args (specifically
the buffer, a void *, in the function (when defining it).
Shortened it a bit by use of implicit ints where allowed.
Updated fixes in README in a better order (not chronological but in a
way that shows how it shows that I fixed it to not require
-traditional-cpp and also fixed the type of args in main() that clang
enforces). The fix by Yusuke Endoh which only let it compile with gcc
(with -traditional-cpp) is below that. To the cynics: this is not
because I want my fix at the top but rather that my fixes make it more
portable which makes it easier to use. With my fix the other one is not
technically even needed but I want to give thanks anyway as he
contributed to it (albeit without knowing about it yet).
Fixed make alt rule so that it uses -traditional-cpp as it needs it.
This code will not work with clang because it doesn't support that
option and it has the type of main() args issue. That means it won't
work with macOS default compiler even gcc.
This one was also fun. By chance I noticed the '{' next to the read()
function. Easy enough to miss when very tired. Anyway I had to prototype
that function as 'int read(int, void *, int)' and then in that function,
in the call to write(2), cast 'i' (which is the void *) to int. This
fixes the problem and now it works with macOS and linux.
Removed this entry from bugs.md.
This was fun to fix. What prompted me to do so is that I noticed that
the patch from Yusuke Endoh actually doesn't work in fedora linux. It never
worked with clang as it required -traditional-cpp and also had
non-standard second and third args type to main (not a char ** but
implicit int). No more. This entry now works with both linux and macOS!
I was able to remove all the macros as they were problematic and not
needed. The code that used them was updated to be what was necessary.
Add to Makefile inclusion of stdio.h and math.h (printf, floor).
Some systems require -lm so that was also added to the Makefile.
Very little else was required to make it work.
The decot.alt.c is the version patched by Yusuke but fixed by me to
compile with fedora's gcc.
Removed this entry from bugs.md.
There were many many README.md files with the wrong heading level for
different sections. These have been changed.
To help go through the changes it should be noted I used sgit and also
here is what is changed:
The 'Try', 'To build' and 'To run' lines have two '#'s. Some had one and
others had three.
An exception is that in 1984/anonymous/README.md for the alternative
code that had three '#'s. This is not consistent yet and it might be
that only two are desired. But for now that one at least has three.
Some years after the entry was published the judges asked them if they
wished to remain anonymous. They said yes but added that they are well
known for their there connection to the C language.
I fixed at the same time the typo that was in this quote as it seemed
that it's better to be clear than to keep a quote exactly as is
especially as it might have not been a copy paste in the first place.
Now you can specify the number of microseconds to sleep in between
writes! This makes it easier to experiment with different speeds as well
as solve any problems if your CPU is too slow or too fast
BTW: is there such a thing as too fast a CPU ? :-) actually yes for
certain code which is probably not as uncommon as you think :-) ).
Now anyone can enjoy 1984/mullender! This was a slight change to code
originally suggested in the faq (which was also updated, see below) made
for modern systems (since CPUs are much faster nowadays the duration for
usleep was much too long so one could not really enjoy the entry).
Updated bugs.md to remove this entry from the bugs.md file.
Also updated faq.md with another item. Unfortunately I had already added
another entry to faq.md and had failed to commit it before doing this
change (and adding it to the faq): how to get X11 entries (or actually
any X11 application) to work in macOS Mountain Lion and beyond. This is
why that faq entry is on this branch. It was not intended but it felt
like this change should be on its own branch / in a separate pull
request. I did not want to temporarily modify faq.md simply for this. I
have more changes to faq.md to make but that'll be on another branch so
that I have these changes there as well.
Changed the position of the everything Makefile rule
in select Makefiles to be consistent with other makefiles.
Fixed Makefile for 1986/stein where everything was not
everything (did not depend on alt).
Simply the Makefile header.
Refer to the //www.ioccc.org/bugs.md URL (that will eventually exist).
Now using CC BY-SA 4.0 License to how you may share and adapt the
Makefile.
Some entries were added to the bugs.md file.
As well some README.md files were updated wrt the bugs some of which
might have been better in an earlier commit.
In some files changed the formatting was fixed to be a proper markdown
file.
There were some typos including that some README.md files that linked to
/winners.html#Cody_Boone_Ferguson actually linked to the non-existent
file /years which obviously would not work.
I also added links to the rest of the places I have fixed entries (but
see below) and I did the same for Yusuke Endoh's fixes.
As well apparently one entry I thought he fixed to compile under modern
systems does not seem to so that entry will have to be revisited another
time. That entry was 1993/jonth.
Those are the main changes here if not all of them.
By a happy chance I found an article that has some words about the entry
from Mullender. See the README.md for the link to that article. We thank
the author of the article for this information!
Some of the files modified include some of the files modified yesterday;
others were not modified yesterday. I backtracked as I noticed some
sections are missing in earlier README.md files. However more have to be
checked in earlier years. I'm committing now as I have to do other
things and am likely done for the day.
The years 1984, 1985 and 1986 have had all winning entry README.md files
updated. This includes formatting, adding author's comments (which in
these years means nothing but still have the section there to indicate
that there were no comments) and possibly other things.
I have updated some - not all - of the 1987 winning entry README.md
files. I have to do other things now but I want these committed. I will
work on the other README.md files another time.