From 59a9faaed75c3d85933b890231ad08158c92584d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 13 Apr 2023 05:06:14 -0700 Subject: [PATCH] Add try command to 1991/dds/README.md + typo fixes The question to ponder is what happens with files that are not BASIC programs. I also fixed some typos and made things (I hope) a bit clearer in the alternate code section. --- 1991/dds/README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/1991/dds/README.md b/1991/dds/README.md index 89e3e3aa6..05ac74b59 100644 --- a/1991/dds/README.md +++ b/1991/dds/README.md @@ -53,6 +53,15 @@ For example, the author suggests trying: ./a.out ``` +What happens if you give the program a C program like itself? Try: + +```sh +./dds dds.c +``` + +You'll get errors yes but what does the generated file look like? What about +other types of files? + ### Alternative code: The alternative code, provided by Cody, allows this entry to work successfully @@ -62,10 +71,11 @@ not messing with the `s` string which is quite complicated. For all Cody knows even changing the length could break functionality and indeed the length would have to be longer for this to work with clang. -How does it work? The code, which you will see in [dds.c](dds.c), `return system(q-6);` -equates to `return system("cc a.c");` but clang by default, at least in macOS, -has default -Werror and there were some warnings. This means that the -compilation failed with clang. In particular it would fail (at least with +How does it work? The code (which you will see in [dds.c](dds.c)) does a `return +system(q-6);` which equates to `return system("cc a.c");` but clang by default, +at least in macOS, has default -Werror and there were some warnings. This means +that the compilation failed with clang (because it didn't use `make` so no +[Makefile](Makefile) was used). In particular it would fail (at least with `LANDER.BAS`) due to a return from `main()` without a return value and the use of functions not yet declared.