title: Are there any common C environments where EOF != -1 or WEOF != -1
body: <p>The C Standard defines <code>EOF</code> and <code>WEOF</code> with the following language:</p>
  <blockquote>
  <p><strong>7.21.1 Input/output&lt;stdio.h&gt; - Introduction</strong></p>
  <p>The header <code>&lt;stdio.h&gt;</code> defines several macros, and declares three types and many functions for performing input and output.</p>
  <p>...</p>
  <p><strong><code>EOF</code></strong></p>
  <p>which expands to an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file, that is, no more input from a stream;</p>
  <p>...</p>
  </blockquote>
  <blockquote>
  <p><strong>7.21.1 Extended multibyte and wide character utilities &lt;wchar.h&gt; - Introduction:</strong></p>
  <p>The header <code>&lt;wchar.h&gt;</code> defines four macros, and declares four data types, one tag, and many functions.</p>
  <p>...</p>
  <p><strong><code>wint_t</code></strong></p>
  <p>which is an integer type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set</p>
  <p><strong><code>WEOF</code></strong></p>
  <p>which expands to a constant expression of type wint_t whose value does not correspond to any member of the extended character set.(328) It is accepted (and returned) by several functions in this subclause to indicate end-of-file, that is, no more input from a stream. It is also used as a wide character value that does not correspond to any member of the extended character set.</p>
  <hr />
  <ol start="328">
  <li>The value of the macro WEOF may differ from that of EOF and need not be negative.</li>
  </ol>
  </blockquote>
  <p><code>EOF</code> is a negative value and it is the only negative value that <code>getc()</code> can return.  I have seen it commonly defined as <code>(-1)</code>, and similarly <code>WEOF</code> defined as <code>((wint_t)-1)</code>.</p>
  <p>Are there any common C environments where either of these macros are defined to something different?</p>
  <p>What is the rationale for the Standard Committee to leave open the possibility of different values and especially a non-negative value for <code>WEOF</code>?</p>