title: What information does variable "scope type" provide that is not already described by variable "linkage type"?
body: <p>In the book &quot;<em>C Programming: A Modern Approach</em>&quot;, Chapter 18 takes on some of the more technical features of declarations. On page 459, the author states that a variable in a C program has three properties:</p>
  <ol>
  <li>Storage Duration - (<em>automatic</em> vs <em>static</em>)</li>
  <li>Scope - (<em>block</em> vs <em>file</em>)</li>
  <li>Linkage - (<em>external</em> vs <em>internal</em> vs <em>none</em>)</li>
  </ol>
  <p>I've poked around on several different websites and several differ S.O. posts, but I am still having some difficulties understanding the differences between <em><strong>scope</strong></em> and <em><strong>linkages</strong></em>.</p>
  <p>One of the major conceptual difficulties I have is determining the <strong>unique information</strong> that is provided by specifying the scope of a variable <em><strong>that is not already given by the linkage type</strong></em>. There seem to be some nuances that I am completely missing.</p>
  <p>Consider the following examples of declarations for variables:</p>
  <hr />
  <p>Case 1:</p>
  <pre><code>void foo(void)
  {
    static int j;  /* block scope + no linkage */
  }
  </code></pre>
  <hr />
  <p>Case 2:</p>
  <pre><code>int i; /* file scope + external linkage */
  
  int main(void)
  {
    .
    .
    .
  }
  </code></pre>
  <hr />
  <p>Case 3:</p>
  <pre><code>static int i; /* file scope + internal linkage */
  
  int main(void)
  {
    .
    .
    .
  }
  </code></pre>
  <hr />
  <p>If you look at the 3 cases, you see that <strong>block scope pairs with no linkage</strong> and <strong>file scope pairs with either internal or external linkage</strong>.</p>
  <p>Therefore, I see no information that is <strong>added</strong> by specifying the scope. That is to say:</p>
  <ol>
  <li>If I know a variable has the feature <em>no linkage</em>, then I know that the scope type must be <em>block</em></li>
  <li>If I know a variable has the feature <em>internal linkage</em> or <em>external linkage</em>, then I know that the scope type must be <em>file</em>.</li>
  </ol>
  <p>I am unfamiliar with code that utilizes  <em>block scope</em> with <em>internal linkage</em>. I am unfamiliar with code that utilizes <em>block scope</em> with <em>external linkage</em>. Finally, I am unfamiliar with code that uses <em>file scope</em> with <em>no linkage</em>.</p>
  <p>So it seems like the <strong>type of linkage provides all the relevant information needed</strong>...so what exactly is the point of scope?</p>
  <p>Thanks!</p>
  <p>Edit:</p>
  <p>Said differently, these terms are <strong>not independent</strong> (there are certain combinations that simply don't exist, at least that's how it seems).</p>
  <p>Here's a picture that I think captures the idea correctly:</p>
  <p><a href="https://i.stack.imgur.com/5irmO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5irmO.png" alt="Linkage Hierarchy" /></a></p>