Rather than having the string that is run via system(3) use
-Wno-return-type the generated code (also in the string) now returns 1;
rather than 'return;' so that main() has a proper return statement.
This means the string was updated and the call to system(3) was also
updated but it is a bit better now. It is hoped that this is the last
time (..yet again..) that this will have to be updated to work with
various systems but as before the magic is in the thanks file, at least
for now.
It came to my attention that some versions of clang trigger and
additional warning that has to be disabled in order to compile the a.c
that the entry generates. This has been fixed.
I am NOT including the translate.c file that I wrote to come up with the
proper string (it encrypts and decrypts though with some limitations) as
I don't want to give it away too much. I MIGHT include it on my website
another time in case it is ever necessary (though the hope and belief is
it won't be but who knows with clang). This would be AFTER the website
has been looked at. This has already taken too much time to fix. It is
now time to finish 1992 and then go on to 1993.
This took less time than the previous fix (to let it work with clang)
because after stupidly doing the decryption/encryption manually I had
decided to write a simple program that does it instead.
Now systems won't whine about gets() being unsafe.
The thanks file further documents how this was done and the bugs.md file
no longer has this entry.
Looking at the author's remarks (which I hadn't checked yet) I was able
to determine how to get the code to disable warnings when compiling the
generated C code. The text
!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo
had to be added to the string 'q' and then
system(q-6);
had to be changed to
system(q-69);
to disable the warnings that clang (at least in macOS - not sure
elsewhere) ended up being errors due to the forcing of -Wno-error.
An important point is that the placement of that text does matter due to
the code:
*o=fopen(q-3,"w");
If the file name is not at the end then what will happen is the 'a.c' file
will not be created as the end of the string 's' will not be (when
decrypted) 'a.c'. At that point the compilation would fail as there is
no file to compile that is created. Thus the end of the string has to
be:
!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!b/d
With this the file can be generated and compiled with both gcc and clang
even if -Werror would otherwise cause problems.
The alt code has been removed and the Makefile no longer has alt code
nor does it have the 'a' rule.
I noticed that I unfortunately fixed two segfaults that should not have
been fixed: if the input file cannot be opened for reading or the output
file cannot be opened for writing this program will crash. Changed both
dds.c and dds.alt.c (which I added to work with clang). The original fix
that allows this entry to work at all (segfaulted always) remains in
both versions.
Updated README.md and bugs.md. In bugs.md I also added a note that the
compiled code uses gets() not fgets() - whatever it might be worth.
The dds.c now does return system(q-6); and the dds.alt.c does the return
system("make a");. This way those who have gcc (more people than not
most likely) they can use it like originally designed. Those with clang
can use the alt target in almost the same way only instead of a.out use
just a.
Updated the README>md to explain everything.
Updated the .gitignore with some globs that should have been there all
along ('a' and 'dds.alt' being the ones that are new).
This was a fun one! There were up to three segfaults fixed and with
clang the generated file could not be compiled. The latter part was
fixed with (unfortunately) something of a hack. I explain below and in
the README.md how to change that part to use just cc if you have gcc
(macOS gcc is actually clang).
The first segfault which was always triggered was due to the code
*q>' '&&(*q)--;
This seems odd at first glance but it's pointing to 's' which was
read-only memory as a char *s. It's now a char s[]. The second and
third segfaults were caused if a file was not specified (or it the one
specified did not exist or couldn't be opened for some reason) and if
the output file could not be opened for writing. The allowing the
generated code to compile with clang is something of a hack
unfortunately. The code return system(q-6); ended up doing return
system("cc a.c"); but depending on the compiler this would trigger
errors due to no function prototype specified and also a case where
main() had a return; without any return value. Because the string s
is complicated and because I did not want to inadvertently mess
something up I changed that code to system("make a"); and then added
the right rule to the Makefile. Thus you now need both make and cc.
If you use gcc you may change the system() call to what was given in
this description to get a more authentic feel. If you do this you must
then run ./a.out not ./a!
We we move 1988-2004 entries from all of a year's winning entries
in a single directory to each winner being in their own sub-directory
under the given year directory.