Get 1992/lush to work with gcc - won't with clang
I used a patch from Yusuke Endoh to get it to work with gcc. Due to the different messages with different compilers it's expected that this won't work with every compiler. I provided a 'runme.sh' script to run the command in the correct way. I made the entry use fgets() not gets(). I updated bugs.md pointing out that it does not work with clang and alternative code is welcome.
This commit is contained in:
1 parent
3865049bde
commit
b945ec015f
5 files changed
+41
-16
No files matched your search
+1
-2
@@ -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
|
||||
|
||||
+17
-11
@@ -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:
|
||||
|
||||
|
||||
+3
-3
@@ -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;;
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make clobber all
|
||||
cc -include stdio.h -o lush lush.c|& ./lush
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user