title: Segmentation Fault: 11 for small C program on macOS 10.14 Mojave
body: <p>I'm not sure why I'm getting <code>Segmentation Fault: 11</code> when trying to compile this small C file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define MIN  97
  #define MAX  122
  #define DIFF 32
  
  int main()
  {
    int c = EOF;
    int i, j;
    int arr[MAX - MIN];
  
    for(i=MIN; i&lt;=MAX; i++)
      arr[i] = 0;
  
    while((c = getchar()) != EOF) {
      if(c &gt;= MIN)
        ++arr[c];
      else
        ++arr[c + DIFF];
    }
  
    for(i=MIN; i&lt;=MAX; i++) {
      printf("|%c|", i);
      for(j=1; j&lt;=arr[i]; j++)
        putchar('-');
      putchar('\n');
    }
    return 0;
  }
  </code></pre>
  
  <p>I'm using Apple's built-in <code>cc</code> which is just Clang/Apple LLVM 10.0.0</p>
  
  <p>This file compiles just fine on macOS 10.13.6, and I don't have any problems compiling any other C files/programs on 10.14; it's just this one file. From my beginner's point of view, this seems like a bug with the OS.</p>
  
  <p>EDIT: This program is a slightly modified example from a K&amp;R exercise I found <a href="https://clc-wiki.net/wiki/K%26R2_solutions:Chapter_1:Exercise_14#Solution_by_mazouzi" rel="nofollow noreferrer">here</a></p>