C89-compliant quines

From-SVN: r26768
This commit is contained in:
Zack Weinberg 1999-05-04 15:15:48 +00:00
parent d234235cb4
commit 50e0211ea0
2 changed files with 7 additions and 0 deletions

2
gcc/pself4.c Normal file
View File

@ -0,0 +1,2 @@
#include <stdio.h>
int main(void){char*p="#include <stdio.h>%cint main(void){char*p=%c%s%c;(void)printf(p,10,34,p,34,10);return 0;}%c";(void)printf(p,10,34,p,34,10);return 0;}

5
gcc/pself5.c Normal file
View File

@ -0,0 +1,5 @@
#include <stdio.h>
#define N '\n'
#define Q '\"'
#define B '\\'
int main(void){char*p="#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B '%c%c'%cint main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}%c";(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}