Additional fix for 1989/fubar
My original fix no longer worked, at least with clang in some systems, because of more strictness in the compiler wrt implicit ints. As the code does not use the Makefile but rather 'cc' (and in an unusual way) 'main()' now has an explicit int. Also, what was previously documented as a bug to be fixed has been changed to INABIAF as it was documented already. Thus it should not be fixed. In fact the judges originally noted that if one specifies the triggering input they should expect an infinite loop and compilation failure.
This commit is contained in:
1 parent
0f66ae6dea
commit
e8d868e0ed
7 files changed
+121
-116
No files matched your search
@@ -10,7 +10,7 @@
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [1989/fubar in bugs.html](../../bugs.html#1989_fubar).
|
||||
@@ -36,7 +36,8 @@ For more detailed information see [1989/fubar in bugs.html](../../bugs.html#1989
|
||||
## Judges' remarks:
|
||||
|
||||
Run this with a single digit argument (or wait a long time and risk an infinite
|
||||
loop as described in the [1989/fubar in bugs.html](../../bugs.html#1989_fubar) file).
|
||||
loop and compilation error as described in the [1989/fubar in
|
||||
bugs.html](../../bugs.html#1989_fubar) file). This is, however, a feature, not a bug.
|
||||
|
||||
The blank line at the beginning of the source is mandatory.
|
||||
Do you know why?
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#define QQ 1
|
||||
#define TT 1
|
||||
#define cc main(c,v) int c; char **v;{char tt[12],qq[7]; int q=0,o=1,l=1,m=1;struct {int c;} f;
|
||||
#define cc int main(c,v) int c; char **v;{char tt[12],qq[7]; int q=0,o=1,l=1,m=1;struct {int c;} f;
|
||||
#define ouroboros qq[6]='\0';tt[11]='\0';if(QQ==atoi(v[1])+1){(void)fprintf(stderr,"%s factorial = %d\n",v[1], TT);exit(1);}o=c+f
|
||||
#define x ;while(EOF!=(o=getchar())){if(l && q=='Q' && o=='Q'){l=0;(void)getchar();(void)fread(qq,6,1,stdin);(void)printf("Q %6d",atoi(qq)+1);}else
|
||||
if(m && q=='T' && o=='T'){m=0;(void)fread(tt,11,1,stdin);(void)printf("T %9d\n",atoi(tt)*QQ);}else {q=o;(void)putchar(o);}}exit(0);}
|
||||
|
||||
@@ -405,7 +405,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<pre><code> make all</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: known bug - please help us fix</code></pre>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1989_fubar">1989/fubar in bugs.html</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<pre><code> ./fubar <number></code></pre>
|
||||
@@ -416,7 +416,8 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
./fubar 2 # run directly</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Run this with a single digit argument (or wait a long time and risk an infinite
|
||||
loop as described in the <a href="../../bugs.html#1989_fubar">1989/fubar in bugs.html</a> file).</p>
|
||||
loop and compilation error as described in the <a href="../../bugs.html#1989_fubar">1989/fubar in
|
||||
bugs.html</a> file). This is, however, a feature, not a bug.</p>
|
||||
<p>The blank line at the beginning of the source is mandatory.
|
||||
Do you know why?</p>
|
||||
<p>NOTE: the file <code>ouroboros.c</code> is created by the program itself so this is why it
|
||||
|
||||
Reference in new issue
Block a user