diff --git a/1992/lush/Makefile b/1992/lush/Makefile index 58e9c652f..8ea016e63 100644 --- a/1992/lush/Makefile +++ b/1992/lush/Makefile @@ -61,7 +61,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= +CINCLUDE= -include stdio.h # Optimization # @@ -128,7 +128,6 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: This entry requires a non-standard K&R C compiler to compile." ${CC} ${CFLAGS} $< -o $@ ${LIBS} lush.again: ${PROG}.c diff --git a/1992/lush/README.md b/1992/lush/README.md index 43ac62bd3..1247bb06c 100644 --- a/1992/lush/README.md +++ b/1992/lush/README.md @@ -9,23 +9,29 @@ make all -### To run +### To run: - make lush.again 2>&1 | ./lush + ./runme.sh - NOTE: This entry requires a non-standard K&R C compiler to compile. -## Judges' comments +[Yusuke Endoh](/winners.html#Yusuke_Endoh) supplied a patch which makes this +work with gcc. Thank you Yusuke! [Cody Boone +Ferguson](/winners.html#Cody_Boone_Ferguson) made it use `fgets()` instead of +`gets()` and also added the `runme.sh` script to demonstrate it (using make was +problematic). Cody notes that unfortunately this does not work with clang due to +different compiler messages. - The program uses error messages issued by the C Proproessor to - generate its message to the world. One program's error is another - program's data! +## Judges' comments: -## Author's comments +The program uses error messages issued by the C Preprocessor to +generate its message to the world. One program's error is another +program's data! - This program is yet another "Hello World." program with a twist. The - string Hello World has been encoded in the error messages the compiler - generates when compiling the source. +## Author's comments: + +This program is yet another "Hello World." program with a twist. The +string Hello World has been encoded in the error messages the compiler +generates when compiling the source. ## Copyright and CC BY-SA 4.0 License: diff --git a/1992/lush/lush.c b/1992/lush/lush.c index c788ea0f0..dc088f4c9 100644 --- a/1992/lush/lush.c +++ b/1992/lush/lush.c @@ -63,8 +63,8 @@ ;;;} ;for ( ; - gets - (_); + fgets + (_,999,stdin); ) { for( #define f 301: @@ -98,7 +98,7 @@ ;if( #define f 111: #define f 220: - v^*t + t[2] && t[3] == 'w' && t[4] == 'a' && t[5] == 'r' && t[6] == 'n' && t[7] == 'i' && t[8] == 'n' && t[9] == 'g' && v^*t &&*t ){v= *t;; diff --git a/1992/lush/runme.sh b/1992/lush/runme.sh new file mode 100755 index 000000000..800acc73e --- /dev/null +++ b/1992/lush/runme.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +make clobber all +cc -include stdio.h -o lush lush.c|& ./lush diff --git a/bugs.md b/bugs.md index 938f00ea9..1bb416948 100644 --- a/bugs.md +++ b/bugs.md @@ -113,6 +113,14 @@ any problems. Entries with this status do not work under some OSes and/or architectures (and/or something else?). Please help us to fix it! +## STATUS: doesn't work with some compilers - please provide alternative code + +Some entries do not work with some compilers. A good example is +[1992/lush](1992/lush/lush.c) which uses error messages from the compiler to +generate its output. + +Please help us by writing alternative code! + ## STATUS: main() function args not allowed - please help us fix Entries with this status have a problem in that the args to main() are not of a @@ -440,6 +448,14 @@ so it should stay with this note. # 1992 +## [1992/lush](1992/lush/lush.c) ([README.md](1992/lush/README.md)) +## STATUS: doesn't work with some compilers - please provide alternative code + +We used a patch from [Yusuke Endoh](/winners.html#Yusuke_Endoh) to get this to +work but it only works with gcc. Unfortunately due to the way the entry works +and the fact that other compilers like clang have different warnings and errors +this simply does not work with them. Can you help us? + # 1993