Fix 1988/dale to no longer need -traditional-cpp
There were a couple problems to resolve. First
#define a(x)get/***/x/***/id())
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
...
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*getgid());};C++;
does not work to create getuid() and getgid(). The second is that
for/*/(;;);/*/k()){O/*/*/c);
cannot form 'fork())' in modern C compilers. What is quite fun is that
the cpp can!
Removed this entry from bugs.md.
This commit is contained in:
1 parent
06a5665f5d
commit
5e2d3e6bf1
4 files changed
+48
-25
No files matched your search
+1
-1
@@ -117,7 +117,7 @@ ALT_TARGET=
|
|||||||
|
|
||||||
# FORCE use of -traditional-cpp
|
# FORCE use of -traditional-cpp
|
||||||
#
|
#
|
||||||
CFLAGS+= -traditional-cpp
|
#CFLAGS+= -traditional-cpp
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# build the entry
|
# build the entry
|
||||||
|
|||||||
+44
-13
@@ -1,28 +1,57 @@
|
|||||||
## Best abuse of system calls
|
## Best abuse of system calls
|
||||||
|
|
||||||
Paul Dale
|
Paul Dale
|
||||||
University of Queensland
|
University of Queensland
|
||||||
Computer Science Dept
|
Computer Science Dept
|
||||||
Dept of Computer Science
|
Dept of Computer Science
|
||||||
Uni of Qld, 4067
|
Uni of Qld, 4067
|
||||||
Australia
|
Australia
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
make all
|
```sh
|
||||||
|
make all
|
||||||
|
```
|
||||||
|
|
||||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern
|
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern
|
||||||
systems. Modern compilers do not allow directives like:
|
compilers. There were two problems to address. One was that the entry required
|
||||||
|
`-traditional-cpp` which it no longer does. It needed this because of two things
|
||||||
|
it did:
|
||||||
|
|
||||||
#define _ define
|
```c
|
||||||
-#_ foo bar
|
#define a(x)get/***/x/***/id())
|
||||||
|
|
||||||
|
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*getgid());};C++;
|
||||||
|
```
|
||||||
|
|
||||||
|
does not work to create `getuid()` and `getgid()`. The second is that
|
||||||
|
|
||||||
|
for/*/(;;);/*/k()){O/*/*/c);
|
||||||
|
|
||||||
|
cannot form 'fork())' in modern C compilers. What is quite fun is that the cpp
|
||||||
|
can!
|
||||||
|
|
||||||
|
The other problem was that modern compilers do not allow directives like:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define _ define
|
||||||
|
+#_ P char
|
||||||
|
+#_ p int
|
||||||
|
+#_ O close(
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
so Cody changed the lines to be in the form of:
|
so Cody changed the lines to be in the form of:
|
||||||
|
|
||||||
#define foo bar
|
```c
|
||||||
|
#define foo bar
|
||||||
|
```
|
||||||
|
|
||||||
Even so this entry requires a compiler that supports the `-traditional-cpp`
|
Thank you Cody for your assistance!
|
||||||
option. Thank you Cody for your assistance!
|
|
||||||
|
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
@@ -31,6 +60,8 @@ option. Thank you Cody for your assistance!
|
|||||||
./dale hello world
|
./dale hello world
|
||||||
./dale these files are in this directory: *
|
./dale these files are in this directory: *
|
||||||
|
|
||||||
|
NOTE: in linux it might happen that core dumps are created when running this
|
||||||
|
entry even though it works fine.
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -14,12 +14,12 @@
|
|||||||
#define a(x)get/***/x/***/id())
|
#define a(x)get/***/x/***/id())
|
||||||
P z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1;
|
P z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1;
|
||||||
q(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{
|
q(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{
|
||||||
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
|
p Z=chroot("/");L(!getuid())execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
|
||||||
while(V){
|
while(V){
|
||||||
case_3:L(!(*C[c]-'-')&&!(C[c][c]-'n')&&!C[c][c<<c])V--,C++,Z=c;
|
case_3:L(!(*C[c]-'-')&&!(C[c][c]-'n')&&!C[c][c<<c])V--,C++,Z=c;
|
||||||
case 1:O/*/*/0)+O(c*c-c+c/c)<<(c*c));dup(c);O/*/*/c);pipe(z);L(
|
case 1:O/*/*/0)+O(c*c-c+c/c)<<(c*c));dup(c);O/*/*/c);pipe(z);L(
|
||||||
for/*/(;;);/*/k()){O/*/*/c);
|
fork()){O c);
|
||||||
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*a(g);};C++;
|
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*getgid());};C++;
|
||||||
f(c/c+c*c,*C,H C));I h;}J O/*/*/c/c+V/V+A*(p)C);
|
f(c/c+c*c,*C,H C));I h;}J O/*/*/c/c+V/V+A*(p)C);
|
||||||
case 0:c=read(1,z,r=H++C));L(c){L(A++)f('-'-'-'-'+'+'+'," ",'/'/'/');
|
case 0:c=read(1,z,r=H++C));L(c){L(A++)f('-'-'-'-'+'+'+'," ",'/'/'/');
|
||||||
f(A-A+c-r-c+r,z,r);}J _exit(Z?Z-Z:Z);};main(chroot("/tmp")+l,C);
|
f(A-A+c-r-c+r,z,r);}J _exit(Z?Z-Z:Z);};main(chroot("/tmp")+l,C);
|
||||||
|
|||||||
@@ -347,14 +347,6 @@ so maybe he's doing something wrong.
|
|||||||
# 1988
|
# 1988
|
||||||
|
|
||||||
|
|
||||||
## [1988/dale](1988/dale/dale.c) ([README.md](1988/dale/README.md))
|
|
||||||
## STATUS: Requires a compiler supporting `-traditional-cpp` - alternate code requested
|
|
||||||
|
|
||||||
This entry needs a compiler that support `-traditional-cpp`. `gcc`
|
|
||||||
supports this but `clang` does not. Please be advised that `gcc` under macOS is
|
|
||||||
actually gcc if it looks like it's gcc (two different binaries).
|
|
||||||
|
|
||||||
|
|
||||||
# 1989
|
# 1989
|
||||||
|
|
||||||
## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md))
|
## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md))
|
||||||
|
|||||||
Reference in new issue
Block a user