Merge pull request #195 from xexyl/1992-lush
Get 1992/lush to work with gcc - won't with clang
This commit is contained in:
5 files changed
+41
-16
No files matched your search
+1
-2
@@ -61,7 +61,7 @@ CDEFINE=
|
|||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
CINCLUDE=
|
CINCLUDE= -include stdio.h
|
||||||
|
|
||||||
# Optimization
|
# Optimization
|
||||||
#
|
#
|
||||||
@@ -128,7 +128,6 @@ all: data ${TARGET}
|
|||||||
supernova deep_magic magic charon pluto
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
@echo "NOTE: This entry requires a non-standard K&R C compiler to compile."
|
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
lush.again: ${PROG}.c
|
lush.again: ${PROG}.c
|
||||||
|
|||||||
+17
-11
@@ -9,23 +9,29 @@
|
|||||||
|
|
||||||
make all
|
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. Thank you Cody!
|
||||||
|
|
||||||
The program uses error messages issued by the C Proproessor to
|
## Judges' comments:
|
||||||
generate its message to the world. One program's error is another
|
|
||||||
program's data!
|
|
||||||
|
|
||||||
## 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
|
## Author's comments:
|
||||||
string Hello World has been encoded in the error messages the compiler
|
|
||||||
generates when compiling the source.
|
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:
|
## Copyright and CC BY-SA 4.0 License:
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -63,8 +63,8 @@
|
|||||||
;;;}
|
;;;}
|
||||||
;for
|
;for
|
||||||
( ;
|
( ;
|
||||||
gets
|
fgets
|
||||||
(_);
|
(_,999,stdin);
|
||||||
) {
|
) {
|
||||||
for(
|
for(
|
||||||
#define f 301:
|
#define f 301:
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
;if(
|
;if(
|
||||||
#define f 111:
|
#define f 111:
|
||||||
#define f 220:
|
#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
|
&&*t
|
||||||
){v=
|
){v=
|
||||||
*t;;
|
*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
|
Entries with this status do not work under some OSes and/or architectures (and/or
|
||||||
something else?). Please help us to fix it!
|
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
|
## 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
|
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
|
||||||
|
|
||||||
|
## [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
|
# 1993
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user