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. 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.
./decot.alt
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.
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.
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