title: CHAR_WIDTH undeclared
body: <p>I get the error 
  <code>‘CHAR_WIDTH’ undeclared</code>
  when I try to compile this simple program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  
  int main()
  {
    printf("CHAR_BIT = %d\n", CHAR_BIT);
    printf("CHAR_WIDTH = %d\n", CHAR_WIDTH);
    return (0);
  }
  </code></pre>
  
  <p>with</p>
  
  <pre><code>gcc ./show_char_width.c -o show_char_width
  </code></pre>
  
  <p>and gcc: GNU C17 (Ubuntu 8.3.0-6ubuntu1) version 8.3.0 (x86_64-linux-gnu) compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.20-GMP,
  kernel: 5.0.0-37-generic.</p>
  
  <p>As stated <a href="https://www.gnu.org/software/libc/manual/html_node/Width-of-Type.html" rel="noreferrer">here</a> CHAR_WIDTH should be defined in limits.h which is included in my program. So why I get this error?</p>
  
  <p>With the <code>-v</code> option I found that the library will be searched in those directories:</p>
  
  <pre><code>#include "..." search starts here:
  #include &lt;...&gt; search starts here:
   /usr/lib/gcc/x86_64-linux-gnu/8/include
   /usr/local/include
   /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed
   /usr/include/x86_64-linux-gnu
   /usr/include
  </code></pre>
  
  <p>/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed contain a limits.h that include syslimits.h from the same dir which in turn include the next limits.h, that from my understanding should be located in the /usr/include directory.</p>
  
  <p>The CHAR_WIDTH macro is indeed defined in those files but under some conditions that exceed my actual knowledge. </p>
  
  <p>The conditions I found untill now are:</p>
  
  <pre><code>
  /* The integer width macros are not defined by GCC's &lt;limits.h&gt; before
     GCC 7, or if _GNU_SOURCE rather than
     __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature.  */
  #if __GLIBC_USE (IEC_60559_BFP_EXT)
  # ifndef CHAR_WIDTH
  #  define CHAR_WIDTH 8
  # endif
  </code></pre>
  
  <p>and :</p>
  
  <pre><code>#ifdef __STDC_WANT_IEC_60559_BFP_EXT__
  /* TS 18661-1 widths of integer types.  */
  # undef CHAR_WIDTH
  # define CHAR_WIDTH __SCHAR_WIDTH__
  </code></pre>
  
  <p>That's why I need your help.</p>
  
  <p>Note: I get the same error with all other macros described in A.5.1 notably: SCHAR_WIDTH, INT_WIDTH, LONG_WIDTH, etc.</p>