add hack-a-round for language specified markdown code blocks

When language is specified in a markdown code block such as:

````
```c
    printf("Hello, world!\n");
```
````

is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.

A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment.  For example:

````
```<!---c-->
    printf("Hello, world!\n");
```
````

This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better  "_hack-a-round_" to the "markdown code language
specifier" problem is found.

The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:

```
<pre class="&lt;!---c--&gt;"><code> .. </code></pre>
```

We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.

For now, this hack-a-round will have to do.
This commit is contained in:
Landon Curt Noll committed 2024-04-04 14:50:38 -07:00
1 parent 3919df50fb
commit b66c79254a
700 files changed
+7052 -7056

No files matched your search

+227 -227
View File
@@ -186,9 +186,9 @@ bringing back an extern declaration (slightly changing it to match the symbol
that it is i.e. <code>extern double floor(double);</code> instead of <code>extern int floor;</code>)
and also bringing back <code>double (x1, y1) b;</code> and even this funny code that could
be kept in:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define char k</span><span class="op">[</span><span class="ch">&#39;a&#39;</span><span class="op">]</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">char</span> x <span class="op">{</span><span class="kw">sizeof</span><span class="op">(</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">double</span><span class="op">(%</span>s<span class="op">,%</span>D<span class="op">)(*)())</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define char k[&#39;a&#39;]
char x {sizeof(
double(%s,%D)(*)())</code></pre>
<p>This does mean that there cannot be a second arg to <code>main()</code>
as clang requires that to be a <code>char ** and the</code>char<code>redefined would not allow this. Some versions of clang say that</code>main()<code>must have either 0, 2 or 3 args but these versions do not object to 1 arg. However as the</code>char<code>macro seems more obscure and it is possible that a new version of clang will be even more strict the</code>int i<code>parameter in</code>main()<code>was moved to be inside</code>main()<code>, set to non-zero (setting</code>i<code>to 0 will not work). This way</code>main()` has zero
args.</p>
@@ -203,7 +203,7 @@ seems possible) it is easy to fix but it is hoped that this won’t happen.</p>
<p>Originally <a href="#yusuke">Yusuke</a> supplied a patch so that this entry would compile with gcc -
but not clang - or at least some versions.</p>
<p>To see the difference from start to fixed:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">cd</span> 1984/decot <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cd 1984/decot ; make diff_orig_prog</code></pre>
<h2 id="laman-index.html"><a name="1984_laman"></a><a href="1984/laman/laman.c">1984/laman</a> (<a href="1984/laman/index.html%5D">index.html</a>)</h2>
<p><a href="#cody">Cody</a> added the <a href="1984/laman/try.sh">try.sh</a> script.</p>
<p>Cody also fixed this to not crash when no arg is specified. Note that if the arg
@@ -288,7 +288,7 @@ as close to the original as one can get without causing compiler errors.</p>
<p>To get this to all work the following changes were made. If you really want to
understand this Cody provides the following. First run the following command
from the directory:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make diff_orig_prog</code></pre>
<p>and then read the following (you might also wish to look at the code in an
editor with syntax highlighting):</p>
<ul>
@@ -296,11 +296,11 @@ editor with syntax highlighting):</p>
were actually not what they appear: the only arg that existed in <code>main()</code> was
<code>Manual</code>. Thus it now looks like:</li>
</ul>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="co">/* C program. (If you don&#39;t</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co"> * understand it look it</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co"> * up.) (In the C*/</span> Manual<span class="op">)</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(
/* C program. (If you don&#39;t
* understand it look it
* up.) (In the C*/ Manual)
{</code></pre>
<ul>
<li><p>The macros <code>C</code> and <code>V</code> were changed to lower case. This is because it felt
like the <code>C=" ..</code>’ part in <code>subr()</code> would be better to be upper case as it talks
@@ -318,13 +318,13 @@ in case the first does not. Originally the macros were kept the same and the
case as <code>c</code>.</p></li>
<li><p>The code:</p></li>
</ul>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> C<span class="op">=</span><span class="st">&quot;Lint says &quot;</span>argument Manual isn<span class="ch">&#39;t</span><span class="er"> used.&quot; What</span><span class="ch">&#39;</span>s that</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> mean<span class="op">?</span><span class="st">&quot;; while (write((read(C_C(&#39;&quot;</span><span class="ch">&#39;-&#39;</span><span class="co">/*&quot;&#39;/*&quot;*/</span><span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">+</span>C_C_<span class="op">(</span><span class="ch">&#39;</span><span class="sc">\t</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">))+</span><span class="dv">1</span><span class="op">),</span><span class="dv">1</span><span class="op">),&amp;</span>_<span class="op">,</span><span class="dv">1</span><span class="op">));</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> C=&quot;Lint says &quot;argument Manual isn&#39;t used.&quot; What&#39;s that
mean?&quot;; while (write((read(C_C(&#39;&quot;&#39;-&#39;/*&quot;&#39;/*&quot;*/))?__:__-_+
&#39;\b&#39;b&#39;\b&#39;|((_-52)%(&#39;\b&#39;b&#39;\b&#39;+C_C_(&#39;\t&#39;b&#39;\n&#39;))+1),1),&amp;_,1));</code></pre>
<p>had to be changed to:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> C<span class="op">=</span><span class="st">&quot;Lint says </span><span class="sc">\&quot;</span><span class="st">argument Manual isn&#39;t used.</span><span class="sc">\&quot;</span><span class="st"> What&#39;s that</span><span class="op">\</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="st"> mean?&quot;</span><span class="op">;</span> <span class="cf">while</span> <span class="op">(</span>write<span class="op">((</span>read<span class="op">((</span><span class="ch">&#39;&quot;&#39;</span><span class="op">-</span><span class="ch">&#39;/</span><span class="er">*&quot;</span><span class="ch">&#39;</span><span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">+</span>C_C_<span class="op">(</span><span class="ch">&#39;</span><span class="sc">\t</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">))+</span><span class="dv">1</span><span class="op">),</span><span class="dv">1</span><span class="op">),&amp;</span>_<span class="op">,</span><span class="dv">1</span><span class="op">));</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> C=&quot;Lint says \&quot;argument Manual isn&#39;t used.\&quot; What&#39;s that\
mean?&quot;; while (write((read((&#39;&quot;&#39;-&#39;/*&quot;&#39;))?__:__-_+
&#39;\b&#39;b&#39;\b&#39;|((_-52)%(&#39;\b&#39;b&#39;\b&#39;+C_C_(&#39;\t&#39;b&#39;\n&#39;))+1),1),&amp;_,1));</code></pre>
<p>because of the missing <code>"</code> at the end of the line and because <code>_|_</code> is not a
function call.</p>
<p>The <code>\"</code> had to be done to keep the <code>"</code>s there though the string could be
@@ -340,12 +340,12 @@ rename to <code>c</code>.</p>
<ul>
<li>The code in <code>main()</code> is where there are significant changes, changing from:</li>
</ul>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">while</span> <span class="op">(</span>read<span class="op">(</span><span class="dv">0</span><span class="op">,&amp;</span>__<span class="op">,</span><span class="dv">1</span><span class="op">)</span> <span class="op">&amp;</span> write<span class="op">((</span>_<span class="op">=(</span>_<span class="op">=</span>C_C_<span class="op">(</span>__<span class="op">),</span>C<span class="op">)),</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> _C_<span class="op">,</span><span class="dv">1</span><span class="op">))</span> _<span class="op">=</span>C<span class="op">-</span>V<span class="op">+</span>subr<span class="op">(&amp;</span>V<span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> while (read(0,&amp;__,1) &amp; write((_=(_=C_C_(__),C)),
_C_,1)) _=C-V+subr(&amp;V);</code></pre>
<p>to:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">while</span> <span class="op">(</span>read<span class="op">(</span><span class="dv">0</span><span class="op">,&amp;</span>__<span class="op">,</span><span class="dv">1</span><span class="op">)</span> <span class="op">&amp;</span> write<span class="op">((</span>_<span class="op">=(</span>_<span class="op">=</span>C_C_<span class="op">(</span>__<span class="op">),</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> V<span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span><span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\b</span><span class="ch">&#39;</span><span class="op">+~</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="ch">&#39; &#39;</span><span class="op">&amp;</span><span class="ch">&#39;</span><span class="sc">\t</span><span class="ch">&#39;</span>b<span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">)+</span><span class="dv">1</span><span class="op">),</span><span class="dv">1</span><span class="op">),&amp;</span>_<span class="op">,</span><span class="dv">1</span><span class="op">))</span>_<span class="op">=</span>c<span class="op">-</span>v<span class="op">+</span>subr<span class="op">(&amp;</span>v<span class="op">));</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> while (read(0,&amp;__,1) &amp; write((_=(_=C_C_(__),
V))?__:__-_+&#39;\b&#39;b&#39;\b&#39;|((_-52)%(&#39;\b&#39;b&#39;\b&#39;+~
&#39; &#39;&amp;&#39;\t&#39;b&#39;\n&#39;)+1),1),&amp;_,1))_=c-v+subr(&amp;v));</code></pre>
<p>Note how numerous of the macros (though two changed in case) can still be
used but some cannot be. Can you figure out why? Why too is it that the
<code>subr()</code> function is called but it appears that some of the code in that
@@ -399,14 +399,14 @@ for entertainment!</p>
Cody changed the alt code (which was not the same as the original - see above
for details or try <code>make diff_orig_alt</code> in the directory) slightly so that it
was possible to silence it. In particular:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> P <span class="op">(</span> a <span class="op">)</span> <span class="dt">char</span> a <span class="op">;</span> <span class="op">{</span> a <span class="op">;</span> <span class="cf">while</span><span class="op">(</span> a <span class="op">&gt;</span> <span class="st">&quot; B &quot;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> P ( a ) char a ; { a ; while( a &gt; &quot; B &quot;</code></pre>
<p>which gave:</p>
<pre><code> marshall.alt.c:13:55: warning: ordered comparison between pointer and integer (&#39;char&#39; and &#39;char *&#39;)
P ( a ) char a ; { a ; while( a &gt; &quot; B &quot;
~ ^ ~~~~~~~~
1 warning generated.</code></pre>
<p>was changed to:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> P <span class="op">(</span> a <span class="op">)</span> <span class="dt">char</span> a <span class="op">;</span> <span class="op">{</span> a <span class="op">;</span> <span class="cf">while</span><span class="op">((</span><span class="dt">char</span> <span class="op">*)</span>a <span class="op">&gt;</span> <span class="st">&quot; B &quot;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> P ( a ) char a ; { a ; while((char *)a &gt; &quot; B &quot;</code></pre>
<p>which gave:</p>
<pre><code> marshall.alt.c:13:48: warning: cast to &#39;char *&#39; from smaller integer type &#39;char&#39; [-Wint-to-pointer-cast]
P ( a ) char a ; { a ; while((char *)a &gt; &quot; B &quot;
@@ -435,54 +435,54 @@ below.</p>
work with gcc but it still required <code>-traditional-cpp</code>.</p>
<p>If you’d like to see the difference between the version that requires
<code>-traditional-cpp</code> and the fixed version, try:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">cd</span> 1986/wall <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cd 1986/wall ; make diff_orig_prog</code></pre>
<p>Some of the changes required:</p>
<ul>
<li>Instead of using the <code>c_</code>, defined as <code>c_(cc)c cc=</code>, like:</li>
</ul>
<div class="sourceCode" id="cb14"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> c_<span class="op">(+)</span>o</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>c_<span class="op">(+)</span><span class="ch">&#39; &#39;</span><span class="op">-</span><span class="dv">1</span><span class="op">;</span></span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a> <span class="op">}}</span>c_<span class="op">(&amp;)</span><span class="ch">&#39;z&#39;</span><span class="op">+</span><span class="dv">5</span><span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> c_(+)o
/* ... */
:c_(+)&#39; &#39;-1;
}}c_(&amp;)&#39;z&#39;+5;</code></pre>
<p>use:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>c <span class="op">+=</span>o<span class="op">[</span>c<span class="op">&amp;</span>__LINE__<span class="op">-</span><span class="bn">007</span><span class="op">];</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>c<span class="op">+=</span><span class="ch">&#39; &#39;</span><span class="op">-</span><span class="dv">1</span><span class="op">;</span></span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a> <span class="op">}}</span>c<span class="op">&amp;=</span><span class="ch">&#39;z&#39;</span><span class="op">+</span><span class="dv">5</span><span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> :c +=o[c&amp;__LINE__-007];
/* ... */
:c+=&#39; &#39;-1;
}}c&amp;=&#39;z&#39;+5;</code></pre>
<p>Observe however that this macro is still used in the code like:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(;</span>c_<span class="op">(=(*</span>cc<span class="op">);*</span>cc<span class="op">++)</span>c<span class="op">,</span><span class="cf">for</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(;c_(=(*cc);*cc++)c,for);</code></pre>
<ul>
<li>Instead of code like:</li>
</ul>
<div class="sourceCode" id="cb17"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(</span><span class="bn">0xb</span><span class="op">+(</span>c<span class="op">&gt;&gt;</span><span class="dv">5</span><span class="op">),</span>C_<span class="op">(</span>s<span class="op">))</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a> _<span class="ch">&#39;</span><span class="sc">\v</span><span class="ch">&#39;</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>__ _<span class="ch">&#39;</span><span class="sc">\f</span><span class="ch">&#39;</span><span class="op">:</span></span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a> main<span class="op">(</span>c<span class="op">,</span>C_<span class="op">(</span>s<span class="op">));</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(0xb+(c&gt;&gt;5),C_(s))
_&#39;\v&#39;
:__ _&#39;\f&#39;:
main(c,C_(s));</code></pre>
<p>use instead:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(;</span>c_<span class="op">(=(*</span>cc<span class="op">);*</span>cc<span class="op">++)</span>c<span class="op">,</span><span class="cf">for</span><span class="op">);</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define _O</span><span class="op">(</span><span class="pp">s</span><span class="op">)</span><span class="pp">s</span></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a> <span class="cf">switch</span><span class="op">(</span><span class="bn">0xb</span><span class="op">+(</span>c<span class="op">&gt;&gt;</span><span class="dv">5</span><span class="op">)){</span></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a> _<span class="ch">&#39;</span><span class="sc">\v</span><span class="ch">&#39;</span></span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>__ _<span class="ch">&#39;</span><span class="sc">\f</span><span class="ch">&#39;</span><span class="op">:</span></span>
<span id="cb18-6"><a href="#cb18-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">switch</span><span class="op">(</span>c<span class="op">){;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(;c_(=(*cc);*cc++)c,for);
#define _O(s)s
switch(0xb+(c&gt;&gt;5)){
_&#39;\v&#39;
:__ _&#39;\f&#39;:
switch(c){;</code></pre>
<ul>
<li>The macro:</li>
</ul>
<div class="sourceCode" id="cb19"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define C_</span><span class="op">(</span><span class="pp">sand</span><span class="op">)</span><span class="pp">_O</span><span class="op">(</span><span class="pp">sand</span><span class="op">)</span><span class="pp">witch</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define C_(sand)_O(sand)witch</code></pre>
<p>could not be used like:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a> C_<span class="op">(</span>s<span class="op">));</span>_</span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> C_(s));_</code></pre>
<p>to create:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">switch</span><span class="op">);</span>_</span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> switch);_</code></pre>
<p>and neither could the macro:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define O_</span><span class="op">(</span><span class="pp">O</span><span class="op">)</span><span class="pp">_O</span><span class="op">(</span><span class="pp">O</span><span class="op">)</span><span class="pp">stem</span><span class="op">(</span><span class="pp">ccc</span><span class="op">(</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define O_(O)_O(O)stem(ccc(</code></pre>
<p>be used like:</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>O_<span class="op">(</span>sy<span class="op">)</span><span class="st">&quot;;kkt -oa, dijszdijs QQ&quot;</span><span class="op">))</span>_C</span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> :O_(sy)&quot;;kkt -oa, dijszdijs QQ&quot;))_C</code></pre>
<p>to create:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>system<span class="op">(</span>ccc<span class="op">(</span><span class="st">&quot;;kkt -oa, dijszdijs QQ&quot;</span><span class="op">));</span><span class="cf">return</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> :system(ccc(&quot;;kkt -oa, dijszdijs QQ&quot;));return</code></pre>
<ul>
<li>And of course as noted two strings had to be <code>strdup()</code>d.</li>
</ul>
@@ -562,45 +562,45 @@ as well, however.</p>
<p>First of all, as noted above, the entry required <code>-traditional-cpp</code> (which
<strike>not all compilers support</strike> <code>clang</code> does not support). It needed
that option in modern systems because of two things it did:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define a</span><span class="op">(</span><span class="pp">x</span><span class="op">)</span><span class="pp">get</span><span class="co">/***/</span><span class="pp">x</span><span class="co">/***/</span><span class="pp">id</span><span class="op">())</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true" tabindex="-1"></a> p Z<span class="op">=</span>chroot<span class="op">(</span><span class="st">&quot;/&quot;</span><span class="op">);</span>L<span class="op">(!</span>a<span class="op">(</span>u<span class="op">)</span>execv<span class="op">((</span>q<span class="op">(</span>v<span class="op">=</span><span class="st">&quot;/ipu6ljov&quot;</span><span class="op">),</span>v<span class="op">),</span>C<span class="op">);</span>Z<span class="op">-=</span>kill<span class="op">(</span>l<span class="op">);</span></span>
<span id="cb25-6"><a href="#cb25-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-7"><a href="#cb25-7" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span>
<span id="cb25-8"><a href="#cb25-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-9"><a href="#cb25-9" aria-hidden="true" tabindex="-1"></a> case_2<span class="op">:</span>L<span class="op">(!--</span>V<span class="op">){</span>O<span class="co">/*/*/</span>c<span class="op">*</span>c<span class="op">+</span>c<span class="op">);</span>wait<span class="op">(</span>A<span class="op">+</span>c<span class="op">*</span>c<span class="op">-</span>c<span class="op">);</span>L<span class="op">(!</span>Z<span class="op">)</span>f<span class="op">(</span>A<span class="op">,</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">,</span>c<span class="op">);</span><span class="cf">return</span><span class="op">(</span>A<span class="op">*</span>getgid<span class="op">());};</span>C<span class="op">++;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define a(x)get/***/x/***/id())
/* ... */
p Z=chroot(&quot;/&quot;);L(!a(u)execv((q(v=&quot;/ipu6ljov&quot;),v),C);Z-=kill(l);
/* ... */
case_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,&quot;\n&quot;,c);return(A*getgid());};C++;</code></pre>
<p>This macro, <code>a</code>, formed the functions (the names) <code>getuid()</code> and <code>getgid()</code>, but
this no longer works. The code still uses the macro <code>a</code> to form the names but
it’s done differently, using the C token paste operator <code>##</code>. It’s done like
thus:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a> --- i/1988/dale/dale.c</span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a> +++ w/1988/dale/dale.c</span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a> @@ -9,18 +9,18 @@</span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a> #define L if</span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a> #define I goto</span>
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true" tabindex="-1"></a> #define l 1</span>
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true" tabindex="-1"></a> #define f write</span>
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true" tabindex="-1"></a> #define J else</span>
<span id="cb26-9"><a href="#cb26-9" aria-hidden="true" tabindex="-1"></a> -#define a(x)get/***/x/***/id())</span>
<span id="cb26-10"><a href="#cb26-10" aria-hidden="true" tabindex="-1"></a> +#define a(x)get##x##id())</span></code></pre></div>
<pre class="&lt;!---diff--&gt;"><code> --- i/1988/dale/dale.c
+++ w/1988/dale/dale.c
@@ -9,18 +9,18 @@
#define L if
#define I goto
#define l 1
#define f write
#define J else
-#define a(x)get/***/x/***/id())
+#define a(x)get##x##id())</code></pre>
<p>The second is that</p>
<div class="sourceCode" id="cb27"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span><span class="co">/*/(;;);/*/</span>k<span class="op">()){</span>O<span class="co">/*/*/</span>c<span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> for/*/(;;);/*/k()){O/*/*/c);</code></pre>
<p>cannot form <code>fork())</code> in modern C compilers. Since it was not done through a
macro it was simply changed to be <code>fork()</code>, rather than adding a new macro.</p>
<p>The other problem that could not be resolved by the <code>-traditional-cpp</code> was that
modern compilers do not allow directives like:</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define _ define</span></span>
<span id="cb28-2"><a href="#cb28-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">_ P char</span></span>
<span id="cb28-3"><a href="#cb28-3" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">_ p int</span></span>
<span id="cb28-4"><a href="#cb28-4" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">_ O close(</span></span>
<span id="cb28-5"><a href="#cb28-5" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define _ define
#_ P char
#_ p int
#_ O close(
/* ... */</code></pre>
<p>so Cody changed the lines to be in the form of:</p>
<div class="sourceCode" id="cb29"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define P </span><span class="dt">char</span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define p </span><span class="dt">int</span></span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define O close</span><span class="op">(</span></span>
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a> <span class="co">/* ... */</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define P char
#define p int
#define O close(
/* ... */</code></pre>
<p>However, to keep the entry as close to as possible in look, Cody kept the <code>_</code>
macro in place it’s just no longer used.</p>
<p>See the index.html file for details on the original code, provided as an alt
@@ -658,21 +658,21 @@ not strictly necessary but nonetheless more correct, even if not warned against.
<a href="1989/fubar/fubar.sh">fubar.sh</a>.</p>
<p>A strange problem occurred where if one made modifications to the C file it
might end up failing to work even after changing it back. This was resolved by:</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a> --- i/1989/fubar/fubar.sh</span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a> +++ w/1989/fubar/fubar.sh</span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a> @@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then</span>
<span id="cb30-4"><a href="#cb30-4" aria-hidden="true" tabindex="-1"></a> exit 1</span>
<span id="cb30-5"><a href="#cb30-5" aria-hidden="true" tabindex="-1"></a> fi</span>
<span id="cb30-6"><a href="#cb30-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb30-7"><a href="#cb30-7" aria-hidden="true" tabindex="-1"></a> # run/compile it</span>
<span id="cb30-8"><a href="#cb30-8" aria-hidden="true" tabindex="-1"></a> rm -f ouroboros.c x1 x</span>
<span id="cb30-9"><a href="#cb30-9" aria-hidden="true" tabindex="-1"></a> -ex - &lt;&lt;EOF</span>
<span id="cb30-10"><a href="#cb30-10" aria-hidden="true" tabindex="-1"></a> -r fubar.c</span>
<span id="cb30-11"><a href="#cb30-11" aria-hidden="true" tabindex="-1"></a> +ex fubar.c &lt;&lt;EOF</span>
<span id="cb30-12"><a href="#cb30-12" aria-hidden="true" tabindex="-1"></a> 8,9j</span>
<span id="cb30-13"><a href="#cb30-13" aria-hidden="true" tabindex="-1"></a> w ouroboros.c</span>
<span id="cb30-14"><a href="#cb30-14" aria-hidden="true" tabindex="-1"></a> EOF</span>
<span id="cb30-15"><a href="#cb30-15" aria-hidden="true" tabindex="-1"></a> chmod +x ouroboros.c</span></code></pre></div>
<pre class="&lt;!---diff--&gt;"><code> --- i/1989/fubar/fubar.sh
+++ w/1989/fubar/fubar.sh
@@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then
exit 1
fi
# run/compile it
rm -f ouroboros.c x1 x
-ex - &lt;&lt;EOF
-r fubar.c
+ex fubar.c &lt;&lt;EOF
8,9j
w ouroboros.c
EOF
chmod +x ouroboros.c</code></pre>
<p>Cody also ‘modernised’ the script to use <code>bash</code> and fixed for ShellCheck. The
<code>if [ .. ]</code> was changed in the C code as well as the script.</p>
<p>Cody also added the <a href="1989/fubar/try.sh">try.sh</a> script.</p>
@@ -692,11 +692,11 @@ entry and the alt code) anyway, it works out well.</p>
<h2 id="jar.2-index.html"><a name="1989_jar.2"></a><a href="1989/jar.2/jar.2.c">1989/jar.2</a> (<a href="1989/jar.2/index.html%5D">index.html</a>)</h2>
<p><a href="#cody">Cody</a> fixed this to work with modern compilers. Modern compilers do not allow
code like:</p>
<div class="sourceCode" id="cb31"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define D define</span></span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define a include</span></span>
<span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb31-4"><a href="#cb31-4" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">D foo bar</span></span>
<span id="cb31-5"><a href="#cb31-5" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">a &lt;stdio.h&gt;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define D define
#define a include
#D foo bar
#a &lt;stdio.h&gt;</code></pre>
<p>He notes that there <em>is</em> a way to get it (or something close to it) to work. Do
you know how?</p>
<p>Cody also provided the <a href="1989/jar.2/try.sh">try.sh</a> script and the
@@ -739,7 +739,7 @@ index.html for details.</p>
<h2 id="robison-index.html"><a name="1989_robison"></a><a href="1989/robison/robison.c">1989/robison</a> (<a href="1989/robison/index.html%5D">index.html</a>)</h2>
<p><a href="#yusuke">Yusuke Endoh</a> fixed this to compile under modern systems. To see the changes
made, try:</p>
<div class="sourceCode" id="cb33"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">cd</span> 1989/robison <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cd 1989/robison ; make diff_orig_prog</code></pre>
<p>(It adds the C token pasting operator <code>##</code> instead of <code>/**/</code>.)</p>
<p>Cody also added the <a href="1989/robison/try.sh">try.sh</a> script.</p>
<h2 id="tromp-index.html"><a name="1989_tromp"></a><a href="1989/tromp/tromp.c">1989/tromp</a> (<a href="1989/tromp/index.html%5D">index.html</a>)</h2>
@@ -848,11 +848,11 @@ operator itself.</p>
<h2 id="dg-index.html"><a name="1990_dg"></a><a href="1990/dg/dg.c">1990/dg</a> (<a href="1990/dg/index.html%5D">index.html</a>)</h2>
<p><a href="#cody">Cody</a> fixed this for modern systems. There were two problems to be resolved.</p>
<p>One can no longer do:</p>
<div class="sourceCode" id="cb34"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define d define</span></span>
<span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb34-3"><a href="#cb34-3" aria-hidden="true" tabindex="-1"></a> <span class="pp">#</span><span class="er">d b12(x) 12 x</span></span>
<span id="cb34-4"><a href="#cb34-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb34-5"><a href="#cb34-5" aria-hidden="true" tabindex="-1"></a> <span class="co">/* etc. */</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define d define
#d b12(x) 12 x
/* etc. */</code></pre>
<p>so the use of <code>#d</code> is now instead <code>#define</code> (the macro was originally deleted
but later Cody added it back to make it more like the original).</p>
<p>The second problem was suggested by the judges at the time of judging, to do
@@ -904,7 +904,7 @@ again (since it did not work anyway a segfault prevention was added here). He
also fixed some array addressing (some of which might not be strictly necessary
but as he was testing the <code>fibonacci.c</code> bug he ended up changing it anyway).</p>
<p>BTW: why can’t the fix:</p>
<div class="sourceCode" id="cb35"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>a<span class="op">[</span><span class="dv">1</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">2</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">3</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">4</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">5</span><span class="op">]==</span>NULL<span class="op">)</span> <span class="cf">return</span> <span class="dv">1</span><span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> if (a[1]==NULL||a[2]==NULL||a[3]==NULL||a[4]==NULL||a[5]==NULL) return 1;</code></pre>
<p>be changed to just test the value of <code>A</code> when <code>a</code> is argv and <code>A</code> is argc?</p>
<p>Cody also changed the code to use <code>fgets(3)</code>.</p>
<p>Since this program is so incredible the extra fixes were deemed worth having and
@@ -993,21 +993,21 @@ making the generated code return a value from <code>main()</code> rather than ju
changed from <code>char*s</code> to <code>char s[]</code>):</p>
<pre><code> !.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo</code></pre>
<p>and then the call to <code>system()</code> had to be changed to:</p>
<div class="sourceCode" id="cb37"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a> system<span class="op">(</span>q<span class="op">-</span><span class="dv">69</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> system(q-69);</code></pre>
<p>An important point is that the placement of this string in the <code>s</code> array does
matter. This is because of the code:</p>
<div class="sourceCode" id="cb38"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a> <span class="op">*</span>o<span class="op">=</span>fopen<span class="op">(</span>q<span class="op">-</span><span class="dv">3</span><span class="op">,</span><span class="st">&quot;w&quot;</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> *o=fopen(q-3,&quot;w&quot;);</code></pre>
<p>which means the file name that translates to <code>a.c</code> has to be at the end of the
string. Thus the end of the string actually looks like:</p>
<pre><code> !.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!b/d</code></pre>
<p>But then there is the matter of getting the C to use <code>fgets(3)</code>. As can be seen
above it’s not as simple as changing <code>gets(3)</code> to <code>fgets(3)</code>. This was more magic
characters that had to be updated and some added. The C code:</p>
<div class="sourceCode" id="cb40"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a> atoi<span class="op">(</span>gets<span class="op">(</span>b<span class="op">))</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> atoi(gets(b))</code></pre>
<p>is in the string:</p>
<pre><code> bupj)hfut)c**</code></pre>
<p>which was changed to be (in C):</p>
<div class="sourceCode" id="cb42"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a> atoi<span class="op">(</span>fgets<span class="op">(</span>b<span class="op">,</span><span class="dv">99</span><span class="op">,</span>stdin<span class="op">))</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> atoi(fgets(b,99,stdin))</code></pre>
<p>which in the program is:</p>
<pre><code> bupj)ghfut)c-::-tuejo**</code></pre>
<p>That’s fine and well but since the code does not include <code>stdio.h</code> there
@@ -1024,16 +1024,16 @@ the <code>system(q-86)</code> had to be changed to <code>system(q-104)</code>.</
<p>But then to prevent the need for disabling a warning and to be more correct
code, the generated code was changed to <code>return 1;</code> rather than just <code>return;</code>.
Thus in full the string became:</p>
<div class="sourceCode" id="cb46"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a> <span class="dt">char</span> s<span class="op">[]=</span><span class="st">&quot;Qjou!s</span><span class="sc">\\</span><span class="st">311^-g</span><span class="sc">\\</span><span class="st">311^-n</span><span class="sc">\\</span><span class="st">311^-c</span><span class="sc">\\</span><span class="st">::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[Q&lt;n</span><span class="op">\</span></span>
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a><span class="st"> bjo)*|gps)&lt;&lt;*txjudi)m*|aQdbtf!::::;sfuvso!2&lt;aQefgbvmu;aQ&lt;m,,a%CQ&lt;csfbla</span><span class="sc">%b</span><span class="st">Q&lt;a</span><span class="op">\</span></span>
<span id="cb46-3"><a href="#cb46-3" aria-hidden="true" tabindex="-1"></a><span class="st"> N2!Q</span><span class="sc">\n</span><span class="st">dbtf!aP2Q;m&gt;aP2Q&lt;a%!D12J!JGJHJOJQJFJSJJJMHS%HD12D12N3!N4</span><span class="sc">\n</span><span class="st">JUJT%UQm&gt;aP4</span><span class="op">\</span></span>
<span id="cb46-4"><a href="#cb46-4" aria-hidden="true" tabindex="-1"></a><span class="st"> HC%TQs</span><span class="sc">\\</span><span class="st">q,,^&gt;m,2&lt;m&gt;aP4HC%SD12N1</span><span class="sc">\n</span><span class="st">JNQm&gt;s</span><span class="sc">\\</span><span class="st">..q^aHC%NHb</span><span class="sc">%G</span><span class="st">N1!D32P3%RN1UP1D12JPQU</span><span class="op">\</span></span>
<span id="cb46-5"><a href="#cb46-5" aria-hidden="true" tabindex="-1"></a><span class="st"> aP1HR%PN4</span><span class="sc">\n</span><span class="st">Q&lt;g</span><span class="sc">\\</span><span class="st">(aP3Q(^&gt;aP2Q,2&lt;n</span><span class="sc">\\</span><span class="st">(aP3Q(^&gt;aP4Hb%OD12D12N2!N3</span><span class="sc">\n</span><span class="st">JVP3Q,,&lt;jg)aP3</span><span class="op">\</span></span>
<span id="cb46-6"><a href="#cb46-6" aria-hidden="true" tabindex="-1"></a><span class="st"> Q=&gt;n</span><span class="sc">\\</span><span class="st">(aP3Q(^*m&gt;g</span><span class="sc">\\</span><span class="st">(aP3Q(^&lt;fmtf!m,,aHC%QN1!N1</span><span class="sc">\n</span><span class="st">J#Qqsjoug)#&amp;e]o#-aP1Q*aHb%#Qq</span><span class="op">\</span></span>
<span id="cb46-7"><a href="#cb46-7" aria-hidden="true" tabindex="-1"></a><span class="st"> vut)aP1Q*aHb</span><span class="sc">%F</span><span class="st">N1</span><span class="sc">\n</span><span class="st">Qm&gt;::::aHC%VP3Q&gt;bupj)ghfut)c-::-tuejo**aHb%JD12JON1!Qjg)a%</span><span class="op">\</span></span>
<span id="cb46-8"><a href="#cb46-8" aria-hidden="true" tabindex="-1"></a><span class="st"> LN1UP1D12JIQUaP1HL%IQ*m&gt;aN2!N2</span><span class="sc">\n</span><span class="st">P2Q&lt;fmtf!m,,aHC%MN1!N2&gt;P2Q&gt;aN2</span><span class="sc">\n</span><span class="st">P2Hbdd!.Xop.</span><span class="op">\</span></span>
<span id="cb46-9"><a href="#cb46-9" aria-hidden="true" tabindex="-1"></a><span class="st"> fssps!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!.Xop.jnqmjdju.jou!.jodmvef!tuejp/i!</span><span class="op">\</span></span>
<span id="cb46-10"><a href="#cb46-10" aria-hidden="true" tabindex="-1"></a><span class="st"> b/d&quot;</span><span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> char s[]=&quot;Qjou!s\\311^-g\\311^-n\\311^-c\\::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[Q&lt;n\
bjo)*|gps)&lt;&lt;*txjudi)m*|aQdbtf!::::;sfuvso!2&lt;aQefgbvmu;aQ&lt;m,,a%CQ&lt;csfbla%bQ&lt;a\
N2!Q\ndbtf!aP2Q;m&gt;aP2Q&lt;a%!D12J!JGJHJOJQJFJSJJJMHS%HD12D12N3!N4\nJUJT%UQm&gt;aP4\
HC%TQs\\q,,^&gt;m,2&lt;m&gt;aP4HC%SD12N1\nJNQm&gt;s\\..q^aHC%NHb%GN1!D32P3%RN1UP1D12JPQU\
aP1HR%PN4\nQ&lt;g\\(aP3Q(^&gt;aP2Q,2&lt;n\\(aP3Q(^&gt;aP4Hb%OD12D12N2!N3\nJVP3Q,,&lt;jg)aP3\
Q=&gt;n\\(aP3Q(^*m&gt;g\\(aP3Q(^&lt;fmtf!m,,aHC%QN1!N1\nJ#Qqsjoug)#&amp;e]o#-aP1Q*aHb%#Qq\
vut)aP1Q*aHb%FN1\nQm&gt;::::aHC%VP3Q&gt;bupj)ghfut)c-::-tuejo**aHb%JD12JON1!Qjg)a%\
LN1UP1D12JIQUaP1HL%IQ*m&gt;aN2!N2\nP2Q&lt;fmtf!m,,aHC%MN1!N2&gt;P2Q&gt;aN2\nP2Hbdd!.Xop.\
fssps!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!.Xop.jnqmjdju.jou!.jodmvef!tuejp/i!\
b/d&quot;;</code></pre>
<p>and it now is <code>system(q-87);</code>.</p>
<p>It is hoped that this is the last time the string has to be updated to work with
all versions of clang but if not the above is how it works.</p>
@@ -1104,16 +1104,16 @@ the change to check for a <code>NULL</code> file was added. Then it was noticed
problem is that <code>adgrep.c</code> was an incorrect reference that never existed and it
was never fixed in any of the files, not the code or the documentation, and thus
was entirely incorrect code. A fun fact is that one can do:</p>
<div class="sourceCode" id="cb47"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a> W<span class="op">=</span> fopen<span class="op">(</span>wc<span class="op">&gt;=</span> <span class="dv">2</span> <span class="op">?</span> V<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">:</span> __FILE__<span class="op">,</span><span class="st">&quot;rt&quot;</span><span class="op">);</span><span class="cf">if</span><span class="op">(!</span>W<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> W= fopen(wc&gt;= 2 ? V[1] : __FILE__,&quot;rt&quot;);if(!W)exit(1);</code></pre>
<p>but one <em>CANNOT</em> do:</p>
<div class="sourceCode" id="cb48"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a> W<span class="op">=</span> fopen<span class="op">(</span>wc<span class="op">&gt;=</span> <span class="dv">2</span> <span class="op">?</span> V<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">:</span> __FILE__<span class="op">,</span><span class="st">&quot;rt&quot;</span><span class="op">);</span><span class="cf">if</span><span class="op">(!</span>W<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span>
<span id="cb48-2"><a href="#cb48-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>W<span class="op">==</span>NULL<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> W= fopen(wc&gt;= 2 ? V[1] : __FILE__,&quot;rt&quot;);if(!W)exit(1);
if (W==NULL)exit(1);</code></pre>
<p>because <code>adwc.c</code> will be empty! The difference is it is on a newline, the check.
This is an example of how a simple change in code can break it and this is also
true of another change as further below.</p>
<p>Cody also restored a slightly more obscure line of code that had been changed:</p>
<div class="sourceCode" id="cb49"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a> - putc(&quot;}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR&quot;[i]+i-9,stderr);</span>
<span id="cb49-2"><a href="#cb49-2" aria-hidden="true" tabindex="-1"></a> + putc(i[&quot;}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR&quot;]+i-9,stderr);</span></code></pre></div>
<pre class="&lt;!---diff--&gt;"><code> - putc(&quot;}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR&quot;[i]+i-9,stderr);
+ putc(i[&quot;}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR&quot;]+i-9,stderr);</code></pre>
<p>though it’s questionable how much more (if at all) obscure that is :-)</p>
<p>Cody also changed the location that it used <code>gets()</code> to be <code>fgets(3)</code>.
This was complicated because of how the other source files are generated (as
@@ -1133,7 +1133,7 @@ removal of the extra line (as in with a comma operator or a <code>&amp;&amp;</co
might be expected from the above, caused compilation errors with another
generated file (<code>adwc.c</code>)! Thus after the <code>gets(3)</code> call in the line that looks
like:</p>
<div class="sourceCode" id="cb50"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">while</span><span class="op">(</span> gets<span class="op">(</span>Y<span class="op">)</span> <span class="op">){</span> Y<span class="op">[</span>strlen<span class="op">(</span>Y<span class="op">)-</span><span class="dv">1</span><span class="op">]=</span><span class="ch">&#39;</span><span class="sc">\0</span><span class="ch">&#39;</span><span class="op">;</span> <span class="cf">if</span><span class="op">(</span>A<span class="op">(</span>Y<span class="op">))</span> puts<span class="op">(</span>Y<span class="op">);</span> <span class="op">}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> while( gets(Y) ){ Y[strlen(Y)-1]=&#39;\0&#39;; if(A(Y)) puts(Y); }</code></pre>
<p>one must keep the <code>Y[strlen(Y)-1]='\0';</code> part and keep it there.</p>
<p>These fixes are complex changes due to the way the program and Makefile generate
the additional tools.</p>
@@ -1305,8 +1305,8 @@ mentioned script on all the data files.</p>
<p>Both <a href="#cody">Cody</a> and <a href="#yusuke">Yusuke</a> fixed this so that it will work with modern systems. Yusuke
provided some fixes of the X code and Cody fixed the C pre-processor directives
so that it would compile. It used to be that you could get away with code like:</p>
<div class="sourceCode" id="cb51"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a> G <span class="dt">int</span> i<span class="op">,</span>j</span>
<span id="cb51-2"><a href="#cb51-2" aria-hidden="true" tabindex="-1"></a> K <span class="cf">case</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> G int i,j
K case</code></pre>
<p>and expect <code>G;</code> to equate to <code>int i, j;</code> (though it’s now a long) and <code>K</code> to mean
<code>case</code> but that’s no longer the case so the offending lines had <code>#define</code>
prepended to them.</p>
@@ -1708,7 +1708,7 @@ larger the resulting program becomes. It can be gigabytes in length if it
doesn’t crash. At this point since the author stated it has no <code>while</code>,
<code>do...while</code>, <code>for</code>, <code>if/else</code>, <code>switch</code>, <code>?:</code> Cody removed the if statement by
doing:</p>
<div class="sourceCode" id="cb53"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a> <span class="op">((</span>V<span class="op">[</span><span class="dv">1</span><span class="op">]&amp;&amp;((</span>atoi<span class="op">(</span>V<span class="op">[</span><span class="dv">1</span><span class="op">])&gt;</span><span class="dv">0</span><span class="op">&amp;&amp;</span>atoi<span class="op">(</span>V<span class="op">[</span><span class="dv">1</span><span class="op">])&lt;</span><span class="dv">27</span><span class="op">))||(</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">),</span><span class="dv">1</span><span class="op">)));</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> ((V[1]&amp;&amp;((atoi(V[1])&gt;0&amp;&amp;atoi(V[1])&lt;27))||(exit(1),1)));</code></pre>
<p>Cody also added the <a href="1998/schnitzi/try.sh">try.sh</a> script to help users try the
commands that we recommended as well as some added by him.</p>
<h2 id="schweikh1-index.html-1"><a name="1998_schweikh1"></a><a href="1998/schweikh1/schweikh1.c">1998/schweikh1</a> (<a href="1998/schweikh1/index.html%5D">index.html</a>)</h2>
@@ -1732,7 +1732,7 @@ was changed back to the original.)</p>
not exist, it would dereference a NULL pointer and very likely crash or halt and
catch fire :-), preventing the entry from working. Notice how <code>H</code> is a funny
macro defined as:</p>
<div class="sourceCode" id="cb54"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">%:define H</span><span class="op">(</span><span class="pp">x</span><span class="op">)</span><span class="pp"> </span><span class="op">&lt;</span><span class="pp">st</span><span class="op">%:%:</span><span class="pp">x</span><span class="op">##.</span><span class="pp">h</span><span class="op">&gt;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> %:define H(x) &lt;st%:%:x##.h&gt;</code></pre>
<p>and yet the <code>FILE *</code> can be called <code>H</code>! This might or might not make sense to
you but if it doesn’t can you figure out why?</p>
<p>Another fix is that previously the program would <code>return 1</code> if a file failed to
@@ -1928,9 +1928,9 @@ was supposed to do; instead it reported text file busy error.</p>
<p>Notice that the location of <code>munmap()</code> and <code>close()</code> followed by <code>execv()</code> <em>does
matter</em>!</p>
<p>To get this to compile with clang, <code>main()</code> had to change from:</p>
<div class="sourceCode" id="cb59"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a> main <span class="op">(</span><span class="dt">char</span> <span class="op">*</span>ck<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>k<span class="op">)</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main (char *ck, char **k)</code></pre>
<p>to:</p>
<div class="sourceCode" id="cb60"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a> main <span class="op">(</span><span class="dt">int</span> cka<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>k<span class="op">)</span> <span class="op">{</span> <span class="dt">char</span> <span class="op">*</span>ck <span class="op">=</span> <span class="op">(</span><span class="dt">char</span> <span class="op">*)</span>cka<span class="op">;</span> <span class="co">/* ... */</span> <span class="op">}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main (int cka, char **k) { char *ck = (char *)cka; /* ... */ }</code></pre>
<p>The following change was also made to be more portable, in case the constants
<code>PROT_READ</code> and/or <code>PROT_WRITE</code> are not standardised or some platform does not
follow it:</p>
@@ -1939,16 +1939,16 @@ follow it:</p>
macOS and Linux).</p>
<p>NOTE: there might be educational value to see the progress of this fix; if you
wish to see, try the following commands from the <code>2001/anonymous</code> directory:</p>
<div class="sourceCode" id="cb61"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..93aa8d79f208dcccc3c5a2370a727b5cf64e9c53 anonymous.c</span>
<span id="cb61-2"><a href="#cb61-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff 93aa8d79f208dcccc3c5a2370a727b5cf64e9c53..c48629017117379a52b1a512ef8f2593ca9569c8 anonymous.c</span>
<span id="cb61-3"><a href="#cb61-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddfd0de82d2f41 anonymous.c</span>
<span id="cb61-4"><a href="#cb61-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff efdee208a2bc650256637b9357ddfd0de82d2f41..e9a3f77ea3b209e63ac3f9c06bb84ad86e5ea706 anonymous.c</span>
<span id="cb61-5"><a href="#cb61-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..2159caec4677e0f25ad704a74e04c8196fd6c343 anonymous.c</span>
<span id="cb61-6"><a href="#cb61-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff 2159caec4677e0f25ad704a74e04c8196fd6c343..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..93aa8d79f208dcccc3c5a2370a727b5cf64e9c53 anonymous.c
git diff 93aa8d79f208dcccc3c5a2370a727b5cf64e9c53..c48629017117379a52b1a512ef8f2593ca9569c8 anonymous.c
git diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddfd0de82d2f41 anonymous.c
git diff efdee208a2bc650256637b9357ddfd0de82d2f41..e9a3f77ea3b209e63ac3f9c06bb84ad86e5ea706 anonymous.c
git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..2159caec4677e0f25ad704a74e04c8196fd6c343 anonymous.c
git diff 2159caec4677e0f25ad704a74e04c8196fd6c343..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</code></pre>
<p>Finally to see from start to finish:</p>
<div class="sourceCode" id="cb62"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</code></pre>
<p>or to not use <code>git</code>:</p>
<div class="sourceCode" id="cb63"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make diff_orig_prog</code></pre>
<p>Cody also added a <a href="anonymous.bed.c">program</a> like <a href="anonymous.ten.c">anonymous.ten.c</a>
<a href="https://en.wikipedia.org/wiki/Ten_Green_Bottles">Ten Green Bottles</a> but which
sings <a href="https://allnurseryrhymes.com/ten-in-the-bed/">Ten in the Bed</a> instead.</p>
@@ -2001,12 +2001,12 @@ valid, BTW.</p>
<p><a href="#cody">Cody</a> added a value to <code>return</code> in <code>main()</code> to make it more portable.</p>
<p>Cody fixed this to compile with clang in Linux. The problem was C99 does not
support implicit int:</p>
<div class="sourceCode" id="cb64"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a> coupard<span class="op">.</span>c<span class="op">:</span><span class="dv">31</span><span class="op">:</span><span class="dv">10</span><span class="op">:</span> error<span class="op">:</span> parameter <span class="ch">&#39;h&#39;</span> was not declared<span class="op">,</span> defaults to <span class="ch">&#39;i</span><span class="er">nt</span><span class="ch">&#39;</span><span class="op">;</span> ISO C99 and later <span class="cf">do</span> not support implicit <span class="dt">int</span> <span class="op">[-</span>Wimplicit<span class="op">-</span><span class="dt">int</span><span class="op">]</span></span>
<span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">void</span> e<span class="op">(</span>n<span class="op">,</span>h<span class="op">){</span></span>
<span id="cb64-3"><a href="#cb64-3" aria-hidden="true" tabindex="-1"></a> <span class="op">^</span></span>
<span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a> coupard<span class="op">.</span>c<span class="op">:</span><span class="dv">31</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> parameter <span class="ch">&#39;n&#39;</span> was not declared<span class="op">,</span> defaults to <span class="ch">&#39;i</span><span class="er">nt</span><span class="ch">&#39;</span><span class="op">;</span> ISO C99 and later <span class="cf">do</span> not support implicit <span class="dt">int</span> <span class="op">[-</span>Wimplicit<span class="op">-</span><span class="dt">int</span><span class="op">]</span></span>
<span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">void</span> e<span class="op">(</span>n<span class="op">,</span>h<span class="op">){</span></span>
<span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a> <span class="op">^</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> coupard.c:31:10: error: parameter &#39;h&#39; was not declared, defaults to &#39;int&#39;; ISO C99 and later do not support implicit int [-Wimplicit-int]
void e(n,h){
^
coupard.c:31:8: error: parameter &#39;n&#39; was not declared, defaults to &#39;int&#39;; ISO C99 and later do not support implicit int [-Wimplicit-int]
void e(n,h){
^</code></pre>
<p>and for some reason it was being reported as an error. This was not really worth
a thanks per se but it was originally done by adding <code>int</code>. The better solution
is to disable the warning which is what was done later on to make it more like
@@ -2156,20 +2156,20 @@ Wayback Machine.</p>
<p><a href="#cody">Cody</a> fixed this to compile with gcc (it worked with clang). The problem was the
cpp being unable to parse the generated code (see the index.html for details) and
this ended up with a number of errors like:</p>
<div class="sourceCode" id="cb66"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a> jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">64</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> stray <span class="ch">&#39;#</span><span class="er">#</span><span class="ch">&#39;</span> in program</span>
<span id="cb66-2"><a href="#cb66-2" aria-hidden="true" tabindex="-1"></a> <span class="dv">64</span> <span class="op">|</span> B N##B <span class="op">(</span>I<span class="op">)</span> <span class="op">;</span> \</span>
<span id="cb66-3"><a href="#cb66-3" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^~</span></span>
<span id="cb66-4"><a href="#cb66-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb66-5"><a href="#cb66-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb66-6"><a href="#cb66-6" aria-hidden="true" tabindex="-1"></a> <span class="op">..</span></span>
<span id="cb66-7"><a href="#cb66-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb66-8"><a href="#cb66-8" aria-hidden="true" tabindex="-1"></a> jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">65</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> stray <span class="ch">&#39;#</span><span class="er">#</span><span class="ch">&#39;</span> in program</span>
<span id="cb66-9"><a href="#cb66-9" aria-hidden="true" tabindex="-1"></a> <span class="dv">65</span> <span class="op">|</span> V F##B <span class="op">(</span>B<span class="op">)</span> <span class="op">;</span> \</span>
<span id="cb66-10"><a href="#cb66-10" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^~</span></span>
<span id="cb66-11"><a href="#cb66-11" aria-hidden="true" tabindex="-1"></a> jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">65</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> expected <span class="ch">&#39;;&#39;</span> before <span class="ch">&#39;B&#39;</span></span>
<span id="cb66-12"><a href="#cb66-12" aria-hidden="true" tabindex="-1"></a> <span class="dv">65</span> <span class="op">|</span> V F##B <span class="op">(</span>B<span class="op">)</span> <span class="op">;</span> \</span>
<span id="cb66-13"><a href="#cb66-13" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span> <span class="op">~</span></span>
<span id="cb66-14"><a href="#cb66-14" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> jdalbec.c:64:5: error: stray &#39;##&#39; in program
64 | B N##B (I) ; \
| ^~
..
jdalbec.c:65:5: error: stray &#39;##&#39; in program
65 | V F##B (B) ; \
| ^~
jdalbec.c:65:5: error: expected &#39;;&#39; before &#39;B&#39;
65 | V F##B (B) ; \
| ^ ~
| ;</code></pre>
<p>and various other problems.</p>
<p>Cody also added <a href="2004/jdalbec/index.html#alternate-code">alt code</a> which allows
one to control how many numbers after the <code>:</code> to print before printing a
@@ -2209,41 +2209,41 @@ to the repo for the script instead.</p>
<h2 id="vik2-index.html"><a name="2004_vik2"></a><a href="2004/vik2/vik2.c">2004/vik2</a> (<a href="2004/vik2/index.html">index.html</a>)</h2>
<p><a href="#cody">Cody</a> fixed this to compile in Linux. Although it compiled cleanly in macOS (and
BSD?) the code failed to compile at all in Linux due to:</p>
<div class="sourceCode" id="cb67"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a> cc <span class="op">-</span>E vik2_1<span class="op">.</span>c <span class="op">&gt;</span> vik2_2<span class="op">.</span>c</span>
<span id="cb67-2"><a href="#cb67-2" aria-hidden="true" tabindex="-1"></a> In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">945</span><span class="op">,</span></span>
<span id="cb67-3"><a href="#cb67-3" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">959</span><span class="op">,</span></span>
<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">972</span><span class="op">,</span></span>
<span id="cb67-5"><a href="#cb67-5" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1025</span><span class="op">:</span></span>
<span id="cb67-6"><a href="#cb67-6" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
<span id="cb67-7"><a href="#cb67-7" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
<span id="cb67-8"><a href="#cb67-8" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb67-9"><a href="#cb67-9" aria-hidden="true" tabindex="-1"></a> In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">946</span><span class="op">:</span></span>
<span id="cb67-10"><a href="#cb67-10" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
<span id="cb67-11"><a href="#cb67-11" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
<span id="cb67-12"><a href="#cb67-12" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb67-13"><a href="#cb67-13" aria-hidden="true" tabindex="-1"></a> In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">947</span><span class="op">:</span></span>
<span id="cb67-14"><a href="#cb67-14" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
<span id="cb67-15"><a href="#cb67-15" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
<span id="cb67-16"><a href="#cb67-16" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb67-17"><a href="#cb67-17" aria-hidden="true" tabindex="-1"></a> In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">948</span><span class="op">:</span></span>
<span id="cb67-18"><a href="#cb67-18" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
<span id="cb67-19"><a href="#cb67-19" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
<span id="cb67-20"><a href="#cb67-20" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb67-21"><a href="#cb67-21" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb67-22"><a href="#cb67-22" aria-hidden="true" tabindex="-1"></a> <span class="op">...</span></span>
<span id="cb67-23"><a href="#cb67-23" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb67-24"><a href="#cb67-24" aria-hidden="true" tabindex="-1"></a> In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">182</span><span class="op">:</span></span>
<span id="cb67-25"><a href="#cb67-25" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb67-26"><a href="#cb67-26" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">992</span><span class="op">:</span><span class="dv">85</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">201</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-27"><a href="#cb67-27" aria-hidden="true" tabindex="-1"></a> <span class="dv">992</span> <span class="op">|</span> I</span>
<span id="cb67-28"><a href="#cb67-28" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb67-29"><a href="#cb67-29" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1497</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-30"><a href="#cb67-30" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1498</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-31"><a href="#cb67-31" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1499</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-32"><a href="#cb67-32" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1500</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-33"><a href="#cb67-33" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1501</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-34"><a href="#cb67-34" aria-hidden="true" tabindex="-1"></a> vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1504</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
<span id="cb67-35"><a href="#cb67-35" aria-hidden="true" tabindex="-1"></a> make<span class="op">:</span> <span class="op">***</span> <span class="op">[</span>Makefile<span class="op">:</span><span class="dv">133</span><span class="op">:</span> vik2<span class="op">]</span> Error <span class="dv">1</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> cc -E vik2_1.c &gt; vik2_2.c
In file included from vik2.c:945,
from vik2.c:959,
from vik2.c:972,
from vik2.c:1025:
vik2.c:383:8: error: no macro name given in #ifdef directive
383 | O \
| ^
In file included from vik2.c:946:
vik2.c:383:8: error: no macro name given in #ifdef directive
383 | O \
| ^
In file included from vik2.c:947:
vik2.c:383:8: error: no macro name given in #ifdef directive
383 | O \
| ^
In file included from vik2.c:948:
vik2.c:383:8: error: no macro name given in #ifdef directive
383 | O \
| ^
...
In file included from vik2.c:182:
vik2.c:992:85: error: #include nested depth 201 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
992 | I
| ^
vik2.c:1497:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
vik2.c:1498:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
vik2.c:1499:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
vik2.c:1500:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
vik2.c:1501:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
vik2.c:1504:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
make: *** [Makefile:133: vik2] Error 1</code></pre>
<p>Unfortunately the fix required heavy modification to the original file (see
below) and also inclusion of what used to be generated by the
<a href="2004/vik2/Makefile">Makefile</a> but now it at least works for both Linux and
@@ -2294,7 +2294,7 @@ and 64-bit. The solution has to do with the size difference between <code>int</c
<code>long</code> so that the <code>long*E</code> is now <code>int*E</code>. This solves a specific problem for
Linux (32-bit, 64-bit) and macOS (arm64).</p>
<p>To get the self-test feature to work it was required to remove from the code:</p>
<div class="sourceCode" id="cb68"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb68-1"><a href="#cb68-1" aria-hidden="true" tabindex="-1"></a> O<span class="op">-</span>b<span class="op">-</span>f<span class="op">-</span>u <span class="op">-</span>s<span class="op">-</span>c<span class="op">-</span>a<span class="op">-</span>t<span class="op">-</span>e<span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> O-b-f-u -s-c-a-t-e;</code></pre>
<p>as it caused a compilation error in some of the generated code but served no
purpose, didn’t affect the output of the puzzle and since the ‘string’ is
already in the code there is no problem omitting it.</p>
@@ -2305,19 +2305,19 @@ also not have been necessary if using different flags to <code>cc</code> but thi
portable and caused other problems. This was a complicated fix as it’s in the
comments but in a funny way; the final result to get the test feature to work
is:</p>
<div class="sourceCode" id="cb69"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb69-1"><a href="#cb69-1" aria-hidden="true" tabindex="-1"></a> <span class="op">;;</span> <span class="co">/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/</span></span>
<span id="cb69-2"><a href="#cb69-2" aria-hidden="true" tabindex="-1"></a> <span class="co">/*-e/&#39;s,intZ,int/ Z,g&#39;&gt;c.c;make/c;/ rm/-f/c*/</span></span>
<span id="cb69-3"><a href="#cb69-3" aria-hidden="true" tabindex="-1"></a> <span class="op">;;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> ;; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/
/*-e/&#39;s,intZ,int/ Z,g&#39;&gt;c.c;make/c;/ rm/-f/c*/
;;</code></pre>
<p>changed from:</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a> <span class="op">;;</span> <span class="co">/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s&gt;*/</span></span>
<span id="cb70-2"><a href="#cb70-2" aria-hidden="true" tabindex="-1"></a> <span class="co">/*c.c;cc/c.c /-c*/</span><span class="op">;;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> ;; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s&gt;*/
/*c.c;cc/c.c /-c*/;;</code></pre>
<p>or as a diff:</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb71-1"><a href="#cb71-1" aria-hidden="true" tabindex="-1"></a> -(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s&gt;*/</span>
<span id="cb71-2"><a href="#cb71-2" aria-hidden="true" tabindex="-1"></a> -/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l</span>
<span id="cb71-3"><a href="#cb71-3" aria-hidden="true" tabindex="-1"></a> -[9999],T=42, M,V=32;long*E,k[9999],B[1 &lt;&lt;+21],*N=B+</span>
<span id="cb71-4"><a href="#cb71-4" aria-hidden="true" tabindex="-1"></a> +(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/</span>
<span id="cb71-5"><a href="#cb71-5" aria-hidden="true" tabindex="-1"></a> +/*-e/&#39;s,intZ,int/ Z,g&#39;&gt;c.c;make/c;/ rm/-f/c*/</span>
<span id="cb71-6"><a href="#cb71-6" aria-hidden="true" tabindex="-1"></a> +;;char*A=0,*_,*R,*Q, D[9999],*r,l[9999],T=42, M,V=32;int *E,k[9999],B[1 &lt;&lt;+21],*N=B+</span></code></pre></div>
<pre class="&lt;!---diff--&gt;"><code> -(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s&gt;*/
-/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l
-[9999],T=42, M,V=32;long*E,k[9999],B[1 &lt;&lt;+21],*N=B+
+(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/
+/*-e/&#39;s,intZ,int/ Z,g&#39;&gt;c.c;make/c;/ rm/-f/c*/
+;;char*A=0,*_,*R,*Q, D[9999],*r,l[9999],T=42, M,V=32;int *E,k[9999],B[1 &lt;&lt;+21],*N=B+</code></pre>
<p>Cody also added the <a href="2005/giljade/try.sh">try.sh</a> script which also lets one see
the beauty of the entry without having to use vi(m), should they be afraid of
getting stuck in it (and for ease of use). :-)</p>
@@ -2335,12 +2335,12 @@ not do it implicitly (like macOS does).</p>
<h2 id="mikeash-index.html"><a name="2005_mikeash"></a><a href="2005/mikeash/mikeash.c">2005/mikeash</a> (<a href="2005/mikeash/index.html">index.html</a>)</h2>
<p><a href="#cody">Cody</a> fixed this to work in Linux. The problem was an unknown escape sequence,
<code>\N</code>, which caused a funny compiler error:</p>
<div class="sourceCode" id="cb72"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a> <span class="op">};</span>n b<span class="op">[</span><span class="dv">2048</span><span class="op">];</span><span class="dt">int</span> i</span>
<span id="cb72-2"><a href="#cb72-2" aria-hidden="true" tabindex="-1"></a> mikeash<span class="op">.</span>c<span class="op">:</span> In function <span class="ch">&#39;R&#39;</span><span class="op">:</span></span>
<span id="cb72-3"><a href="#cb72-3" aria-hidden="true" tabindex="-1"></a> mikeash<span class="op">.</span>c<span class="op">:</span><span class="dv">7</span><span class="op">:</span><span class="dv">1</span><span class="op">:</span> error<span class="op">:</span> <span class="ch">&#39;\</span><span class="er">N</span><span class="ch">&#39;</span> not followed by <span class="ch">&#39;{&#39;</span></span>
<span id="cb72-4"><a href="#cb72-4" aria-hidden="true" tabindex="-1"></a> <span class="dv">7</span> <span class="op">|</span> <span class="op">;</span>C<span class="op">!=</span><span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">;</span>A<span class="op">()</span></span>
<span id="cb72-5"><a href="#cb72-5" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
<span id="cb72-6"><a href="#cb72-6" aria-hidden="true" tabindex="-1"></a> mikeash<span class="op">.</span>c<span class="op">:</span><span class="dv">7</span><span class="op">:</span><span class="dv">1</span><span class="op">:</span> error<span class="op">:</span> incomplete universal character name \Ne</span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> };n b[2048];int i
mikeash.c: In function &#39;R&#39;:
mikeash.c:7:1: error: &#39;\N&#39; not followed by &#39;{&#39;
7 | ;C!=&#39;\n&#39;;A()
| ^
mikeash.c:7:1: error: incomplete universal character name \Ne</code></pre>
<p>The problem was that in the string above there was a <code>\Newline</code> but this is
invalid C. This was changed to be <code>\nNewline</code> and then, because the code is
supposed to output itself when fed itself, the reference to <code>'N'</code> had to be
@@ -2370,7 +2370,7 @@ test it on.</p>
<p>Cody also added the <a href="2005/persano/try.sh">try.sh</a> script.</p>
<h2 id="sykes-index.html"><a name="2005_sykes"></a><a href="2005/sykes/sykes.c">2005/sykes</a> (<a href="2005/sykes/index.html%5D">index.html</a>)</h2>
<p><a href="#cody">Cody</a> added the saved (with the <code>SAVE</code> command) BASIC program <code>PET</code> which was:</p>
<pre class="basic"><code> 10 PRINT &quot;2005&#39;S IOCCC BEST EMULATOR&quot;
<pre class="&lt;!---basic--&gt;"><code> 10 PRINT &quot;2005&#39;S IOCCC BEST EMULATOR&quot;
20 PRINT &quot;BY STEPHEN SYKES!&quot;</code></pre>
<p>followed by the commands:</p>
<pre><code> SAVE &quot;PET&quot;
@@ -2799,12 +2799,12 @@ might violate rule 2: the program is really just a decompressor to generate the
real source of the program. So the source of the entry has to be compiled and
then run, and the output has to be compiled to be <code>hou</code>. This allows the real
program to be used. Thus the Makefile rule looks like:</p>
<div class="sourceCode" id="cb75"><pre class="sourceCode makefile"><code class="sourceCode makefile"><span id="cb75-1"><a href="#cb75-1" aria-hidden="true" tabindex="-1"></a> <span class="ch">${</span><span class="dt">PROG</span><span class="ch">}</span>: <span class="ch">${</span><span class="dt">PROG</span><span class="ch">}</span>.c</span>
<span id="cb75-2"><a href="#cb75-2" aria-hidden="true" tabindex="-1"></a> <span class="ch">${</span><span class="dt">CC</span><span class="ch">}</span> <span class="ch">${</span><span class="dt">CFLAGS</span><span class="ch">}</span> <span class="ch">$&lt;</span> -o <span class="ch">$@</span> <span class="ch">${</span><span class="dt">LDFLAGS</span><span class="ch">}</span></span>
<span id="cb75-3"><a href="#cb75-3" aria-hidden="true" tabindex="-1"></a> ./<span class="ch">${</span><span class="dt">PROG</span><span class="ch">}</span> | <span class="ch">${</span><span class="dt">CC</span><span class="ch">}</span> <span class="ch">${</span><span class="dt">CFLAGS</span><span class="ch">}</span> -xc - -o <span class="ch">$@</span> <span class="ch">${</span><span class="dt">LDFLAGS</span><span class="ch">}</span></span></code></pre></div>
<pre class="&lt;!---makefile--&gt;"><code> ${PROG}: ${PROG}.c
${CC} ${CFLAGS} $&lt; -o $@ ${LDFLAGS}
./${PROG} | ${CC} ${CFLAGS} -xc - -o $@ ${LDFLAGS}</code></pre>
<p>which then compiles like:</p>
<div class="sourceCode" id="cb76"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-std</span><span class="op">=</span>gnu11 <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-pedantic</span> <span class="at">-Wno-sign-compare</span> <span class="at">-Wno-strict-prototypes</span> <span class="at">-O3</span> hou.c <span class="at">-o</span> hou <span class="at">-lm</span></span>
<span id="cb76-2"><a href="#cb76-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> <span class="kw">|</span> <span class="fu">cc</span> <span class="at">-std</span><span class="op">=</span>gnu11 <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-pedantic</span> <span class="at">-Wno-sign-compare</span> <span class="at">-Wno-strict-prototypes</span> <span class="at">-O3</span> <span class="at">-xc</span> <span class="at">-</span> <span class="at">-o</span> hou <span class="at">-lm</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -std=gnu11 -Wall -Wextra -pedantic -Wno-sign-compare -Wno-strict-prototypes -O3 hou.c -o hou -lm
./hou | cc -std=gnu11 -Wall -Wextra -pedantic -Wno-sign-compare -Wno-strict-prototypes -O3 -xc - -o hou -lm</code></pre>
<p>The <code>LDFLAGS</code> were updated to have <code>-lm</code> as the author suggested it uses the
<code>math.h</code> library which not all systems link in by default (Linux for instance
does not).</p>
@@ -2925,12 +2925,12 @@ output.</p>
<p><a href="#cody">Cody</a> fixed the code so one can make use of the echo feature, where the
first character of the filename starts with <code>e</code>. The only way it would work
before that is if one did something like:</p>
<div class="sourceCode" id="cb77"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb77-1"><a href="#cb77-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">ln</span> <span class="at">-sf</span> prog eprog</span>
<span id="cb77-2"><a href="#cb77-2" aria-hidden="true" tabindex="-1"></a> <span class="va">PATH</span><span class="op">=</span><span class="va">$PATH</span>:. <span class="kw">;</span> <span class="ex">eprog</span> <span class="st">&#39;...&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ln -sf prog eprog
PATH=$PATH:. ; eprog &#39;...&#39;</code></pre>
<p>since otherwise the first character would not be <code>e</code> but rather a dot
(<code>./eprog</code>). This was done by adding to the Makefile <code>-include libgen.h</code> and
adding to <code>main()</code> after the variable declaration (<code>V*A;</code>) the code:</p>
<div class="sourceCode" id="cb78"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a> <span class="op">*</span>K<span class="op">=</span>basename<span class="op">(*</span>K<span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> *K=basename(*K);</code></pre>
<p>This was done for both the <a href="2015/burton/prog.c">prog.c</a> and
<a href="2015/burton/prog.alt.c">prog.alt.c</a>. The Makefile was also updated to build
<code>eprog</code> and <code>eprog.alt</code> to make use of the feature more easily. Each is a new
@@ -3241,8 +3241,8 @@ longer known.</p>
<h2 id="endoh3-index.html-6"><a name="2020_endoh3"></a><a href="2020/endoh3/prog.c">2020/endoh3</a> (<a href="2020/endoh3/index.html">index.html</a>)</h2>
<p><a href="#cody">Cody</a> fixed the script <a href="2020/endoh3/run_clock.sh">run_clock.sh</a> which gave a
funny error when running it:</p>
<div class="sourceCode" id="cb79"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./run_clock.sh</span>
<span id="cb79-2"><a href="#cb79-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">-bash:</span> ./run_clock.sh: cannot execute: required file not found</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> $ ./run_clock.sh
-bash: ./run_clock.sh: cannot execute: required file not found</code></pre>
<p>If run from within vim a different error message occurred:</p>
<pre><code> /bin/bash: ./run_clock.sh: /usr/bin/end: bad interpreter: No such file or directory</code></pre>
<p>though this was only noticed later on after it was fixed.</p>