title: What is the behavior of iscntrl?
body: <p>The function <code>iscntrl</code> is standardized. Unfortuneately on C99 we have: </p>
  
  <blockquote>
    <p>The iscntrl function tests for any control character</p>
  </blockquote>
  
  <p>Considering the prototype which is <code>int iscntrl(int c);</code> I am expecting something like <code>true</code> for 0..31 and perhaps 127 too. However in the following: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;ctype.h&gt;
  int main()
  {
      int i;
      printf("The ASCII value of all control characters are ");
      for (i=0; i&lt;=1024; ++i)
      {
          if (iscntrl(i)!=0)
              printf("%d ", i);
      }
      return 0;
  }
  </code></pre>
  
  <p>I get this output: </p>
  
  <pre><code>The ASCII value of all control characters are 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
   15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 127 264 288 308 310 320 334 
  336 346 348 372 374 390 398 404 406 412 420 428 436 444 452 458 460 466 468 474 
  476 484 492 500 506 512 518 530 536 542 638 644 656 662 668 682 688 694 700 706 
  708 714 716 718 760 774 780 782 788 798 826 834 836 846 854 856 864 866 874 876 
  882 888 890 892 898 900 908 962 968 970 988 994 1000
  </code></pre>
  
  <p>So I am wondering how this function is implemented behind the scene. I tried to search on the standard library, but the answer is not obvious. </p>
  
  <p><a href="https://github.com/bminor/glibc/search?q=iscntrl&amp;unscoped_q=iscntrl" rel="nofollow noreferrer">https://github.com/bminor/glibc/search?q=iscntrl&amp;unscoped_q=iscntrl</a></p>
  
  <p>Any ideas?</p>