diff --git a/1984/decot/Makefile b/1984/decot/Makefile index 9eb6160d8..d6709ab28 100644 --- a/1984/decot/Makefile +++ b/1984/decot/Makefile @@ -137,6 +137,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -traditional-cpp $< -o $@ ${LIBS} # data files # data: ${DATA} diff --git a/1984/decot/README.md b/1984/decot/README.md index d57e29362..ed0215d26 100644 --- a/1984/decot/README.md +++ b/1984/decot/README.md @@ -8,14 +8,16 @@ Dave Decot make all ``` +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to not +require `-traditional-cpp` which not all compilers support (clang does not +support it for example). Clang is also more strict about the args' types in +`main()` and this was also a problem that Cody fixed, making it work with both +clang and gcc. For the original code with the gcc fix described below, see the +alternate code section below. Thank you Cody for your assistance! + Originally [Yusuke Endoh](/winners.html#Yusuke_Endoh) supplied a patch so that this entry would compile with gcc - but not clang - or at least some versions. -Thank you Yusuke! [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) -noticed this did not work under fedora linux and it definitely didn't work with -macOS as it required a compiler that supports `-traditional-cpp` which clang -does not. Clang also requires that the second and third arguments to main be a -`char **`. Cody fixed both problems and now it works under both macOS and linux -- clang and gcc. Thank you Cody for your assistance! +Thank you Yusuke! ## To run: @@ -23,9 +25,9 @@ does not. Clang also requires that the second and third arguments to main be a ./decot ``` -### Alternative code: +### Alternate code: -The alternative code, [decot.alt.c](decot.alt.c), is the original code that +The alternate code, [decot.alt.c](decot.alt.c), is the original code that requires `-traditional-cpp` and will also run afoul with clang's requirement for the second and third arguments to main() being a `char **` (the fixed version's main() only has one arg, an int). It is a minor fix to Yusuke's fix. Thank you