title: Data Type Mismatch and Conflicting Compilers
body: <p>I'm studying the basic concepts of the C Programming Language on a website called TutorialsPoint. Examples of source code on this website can include a "try it" button that opens up an on-line c programming environment with an on-line c compiler (GNU GCC version 4.7.2). In one example the sizeof() function is demonstrated. Here is the source code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  
  int main() {
  
    printf("Storage size for int : %d \n", sizeof(int));
  
    return 0;
  }
  </code></pre>
  
  <p>Link to the lesson: <a href="http://www.tutorialspoint.com/cprogramming/c_data_types.htm" rel="nofollow">TutorialsPoint - C Data Types</a></p>
  
  <p>When this program is compiled and executed within the on-line programming environment, the following output is produced: </p>
  
  <pre><code>"Storage size for int : 4"
  </code></pre>
  
  <p>When I attempt to compile the same code on my computer using the GNU GCC version 5.2.1, I receive the following error message:</p>
  
  <pre><code>gcc sizeofExample.c
  sizeofExample.c: In function 'main':
  sizeofExample.c:6:10: warning: format '%d' expects argument of type 'int',
  but argument 2 has type 'long unsigned int' [-Wformat=]
    printf("Storage size for int: %d \n", sizeof(int));
           ^
  </code></pre>
  
  <p>Here is my source code, just to be thorough:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  
  int main()
  {
    printf("Storage size for int : %d \n", sizeof(int));
  
    return 0;
  }
  </code></pre>
  
  <p>I understand that this error is the result of a data type mismatch between the %d [int data type] and the sizeof(int) [long unsigned int].</p>
  
  <p>Why does my compiler detect a data type mismatch, while TutorialsPoint's on-line compiler does not?</p>