title: Initialize a `FILE *` variable in C?
body: <p>I've got several oldish code bases that initialize variables (to be able to redirect input/output at will)  like </p>
  
  <p><code>FILE *usrin = stdin, *usrout = stdout;</code></p>
  
  <p>However, gcc (8.1.1, glibc 2.27.9000 on Fedora rawhide) balks at this (<code>initializer is not a compile time constant</code>). Rummaging in <code>/usr/include/stdio.h</code> I see:</p>
  
  <p><code>extern FILE *stdin;</code></p>
  
  <p><code>/* C89/C99 say they're macros. Make them happy */</code></p>
  
  <p><code>#define stdin stdin</code></p>
  
  <p>First, it makes no sense to me that you can't initialize variables this (rather natural) way for such use. Sure, you can do it in later code, but it is a nuisance.</p>
  
  <p>Second, why is the macro expansion not a constant?</p>
  
  <p>Third, what is the rationale for having them be macros?</p>