diff --git a/1984/decot/.gitignore b/1984/decot/.gitignore index d657384b7..074c27a4d 100644 --- a/1984/decot/.gitignore +++ b/1984/decot/.gitignore @@ -2,6 +2,7 @@ # sort with: ../../bin/sgi.sh *.dSYM decot +decot.alt decot.orig indent indent.c diff --git a/1984/decot/Makefile b/1984/decot/Makefile index 4b0488860..80259c727 100644 --- a/1984/decot/Makefile +++ b/1984/decot/Makefile @@ -144,9 +144,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} - +# We CANNOT have the ${CFLAGS} here as -traditional-cpp conflicts with them, +# causing a compilation error in at least some versions of gcc. ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} -traditional-cpp $< -o $@ ${LDFLAGS} + ${CC} -traditional-cpp $< -o $@ ${LDFLAGS} + # data files # data: ${DATA} diff --git a/1984/decot/README.md b/1984/decot/README.md index fa2d66500..9d72a2e10 100644 --- a/1984/decot/README.md +++ b/1984/decot/README.md @@ -40,6 +40,10 @@ can use this version. make alt ``` +Notice that one **CANNOT** have the usual `${CFLAGS}` along with the +`-traditional-cpp` in all systems. This is why the Makefile only has the latter +option as the others conflict with it. + ### Alternate use: @@ -71,14 +75,19 @@ to: for(signal=0;*k *x * __FILE__ *i;) do { ``` -To see what we mean look at the [original source file](%%REPO_URL%%/1984/decot/decot.orig.c). The -[alternate code](%%REPO_URL%%/1984/decot/decot.alt.c) is the version that has this modification. The +To see what we mean look at the [original source +file](%%REPO_URL%%/1984/decot/decot.orig.c) at [line +15](%%REPO_URL%%/1984/decot/decot.orig.c#L15) which has the way it once was. The +[alternate code](%%REPO_URL%%/1984/decot/decot.alt.c) is the version that has +this modification but at [line 16](%%REPO_URL%%/1984/decot/decot.alt.c#L16). The fixed version has instead: ``` for(signal=0;*k *= * __FILE__ *i;) do { ``` +plus a line above it that had to be added. + ## Author's remarks: diff --git a/1984/decot/index.html b/1984/decot/index.html index 67d0b10dd..3b019d56a 100644 --- a/1984/decot/index.html +++ b/1984/decot/index.html @@ -418,6 +418,9 @@ The original code was fixed in 2023 to not require this.

can use this version.

Alternate build:

    make alt
+

Notice that one CANNOT have the usual ${CFLAGS} along with the +-traditional-cpp in all systems. This is why the Makefile only has the latter +option as the others conflict with it.

Alternate use:

    ./decot.alt

Judges’ remarks:

@@ -430,10 +433,14 @@ changed it from:

    for(signal=0;*k * x * __FILE__ *i;) do {

to:

    for(signal=0;*k *x * __FILE__ *i;) do {
-

To see what we mean look at the original source file. The -alternate code is the version that has this modification. The +

To see what we mean look at the original source +file at line +15 which has the way it once was. The +alternate code is the version that has +this modification but at line 16. The fixed version has instead:

    for(signal=0;*k *= * __FILE__ *i;) do {
+

plus a line above it that had to be added.

Author’s remarks:

No remarks were provided by the author.

$ ./decot diff --git a/thanks-for-help.html b/thanks-for-help.html index 272e7a922..d905703fd 100644 --- a/thanks-for-help.html +++ b/thanks-for-help.html @@ -443,12 +443,11 @@ code, to see what had to be done.

Clang is also more strict about the type of args in main() and this was also a problem that Cody fixed, making it work with both clang and gcc.

These fixes worked fine in macOS but it turned out that in some cases with -clang -in Linux it did not work so this had to be further fixed which Cody also did. It -is no longer clear what the problem was as in fedora 38 with clang 16.0.6; the -only difference is it causes additional warnings but it seems to work just fine. -It seems unlikely that a fix was made just for warnings so it is presumed that -there was another problem and thus the change is kept in place.

+clang in Linux it did not work so this had to be further fixed which Cody also +did. It is no longer clear what the problem was as in fedora 38 with clang +16.0.6; the only difference is it causes additional warnings but it seems to +work just fine. It seems unlikely that a fix was made just for warnings so it +is presumed that there was another problem and thus the change is kept in place.

A note about the fix is that the #defined macros that were used still exist but most are not used; they are left in just to make it look more like the original entry. Nevertheless those cannot be used.

@@ -478,10 +477,15 @@ the others are char **s. This is why the arg was removed and the ca do not support -traditional-cpp.

If the ANSI C committee or a new version of clang messes this up (both of which seem possible) it is easy to fix but it is hoped that this won’t happen.

-

Originally Yusuke supplied a patch so that this entry would compile with gcc - -but not clang - or at least some versions.

+

Originally Yusuke supplied a patch so that this entry would compile +with gcc - but not clang - or at least some versions.

To see the difference from start to fixed:

    cd 1984/decot ; make diff_orig_prog
+

Cody later discovered that the make alt rule does not work as the +-traditional-cpp option conflicts with some of the other options. Thus the +make alt rule only uses -traditional-cpp.

+

To see the diff between the original and the alternate code, try:

+
        cd 1984/decot ; make diff_orig_alt

Winning entry: 1984/laman

Winning entry source code: laman.c

diff --git a/thanks-for-help.md b/thanks-for-help.md index 8861d63d6..e9c2f7dd9 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -79,12 +79,11 @@ code, to see what had to be done. problem that Cody fixed, making it work with both `clang` and `gcc`. These fixes worked fine in macOS but it turned out that in some cases with -`clang` -in Linux it did not work so this had to be further fixed which Cody also did. It -is no longer clear what the problem was as in fedora 38 with `clang` 16.0.6; the -only difference is it causes additional warnings but it seems to work just fine. -It seems unlikely that a fix was made just for warnings so it is presumed that -there was another problem and thus the change is kept in place. +`clang` in Linux it did not work so this had to be further fixed which Cody also +did. It is no longer clear what the problem was as in fedora 38 with `clang` +16.0.6; the only difference is it causes additional warnings but it seems to +work just fine. It seems unlikely that a fix was made just for warnings so it +is presumed that there was another problem and thus the change is kept in place. A note about the fix is that the `#define`d macros that were used still exist but most are not used; they are left in just to make it look more like the @@ -123,8 +122,8 @@ do not support `-traditional-cpp`. If the ANSI C committee or a new version of `clang` messes this up (both of which seem possible) it is easy to fix but it is hoped that this won't happen. -Originally [Yusuke](#yusuke) supplied a patch so that this entry would compile with `gcc` - -but not `clang` - or at least some versions. +Originally [Yusuke](#yusuke) supplied a patch so that this entry would compile +with `gcc` - but not `clang` - or at least some versions. To see the difference from start to fixed: @@ -132,6 +131,16 @@ To see the difference from start to fixed: cd 1984/decot ; make diff_orig_prog ``` +Cody later discovered that the `make alt` rule does not work as the +`-traditional-cpp` option conflicts with some of the other options. Thus the +`make alt` rule only uses `-traditional-cpp`. + +To see the diff between the original and the alternate code, try: + +``` + cd 1984/decot ; make diff_orig_alt +``` +
## Winning entry: [1984/laman](1984/laman/index.html) diff --git a/tmp/update-manifest.sh b/tmp/update-manifest.sh index 10e0925d9..6601aafef 100755 --- a/tmp/update-manifest.sh +++ b/tmp/update-manifest.sh @@ -303,6 +303,10 @@ read -r -n 1 -p "Press any key to continue: " echo 1>&2 echo "$(basename "$0"): will now update index.html files." 1>&2 +echo "NOTE: quick-readme2index.sh will not create all index.html" 1>&2 +echo "files: it checks the timestamp of README.md and the respective" 1>&2 +echo "index.html files. Thus if you have not modified all the necessary" 1>&2 +echo "README.md files then you should not use the quick option!" 1>&2 read -r -p "Do you wish to use quick-readme2index.sh (Y/N)? " if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then echo "$(basename "$0"): now will run: bin/all-run.sh -v $CAP_D_FLAG bin/readme2index.sh -v $CAP_D_FLAG" 1>&2 @@ -326,7 +330,6 @@ if ! bin/gen-other-html.sh -v "$CAP_D_FLAG"; then exit 5 fi - read -r -n 1 -p "Press any key to run: $GIT diff: " echo 1>&2 "$GIT" diff @@ -337,6 +340,22 @@ if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then exit 4 fi +echo "$(basename "$0"): now will run: make find_missing_links" +echo "NOTE: this can take a little while." 1>&2 +if ! make find_missing_links; then + echo "problem running make find_missing_links, fix and try again." 1>&2 + echo "NOTE: since everything else was updated, you can just fix the links" 1>&2 + echo "and then run the appropriate make rules to fix just the affected html" 1>&2 + echo "files rather than run this script all over again. If you're in doubt," 1>&2 + echo "you can run:" 1>&2 + echo + echo " make www" 1>&2 + echo + echo "to be absolutely sure that every html file is updated but this is likely" 1>&2 + echo "not needed unless a lot of files had broken links." 1>&2 + exit 5 +fi + if [[ -n "$A_FLAG" ]]; then echo "Do you wish to automatically run the commands:" 1>&2 echo " git add -u" 1>&2