title: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
body: <p>I followed some similar posts to modify the code, however the warnings are still generated.</p>
  
  <pre><code>$ g++ ncfile.c -o ncfile -g -lnetcdf
  
  ncfile.c: In function ‘int main(int, char**)’:
  ncfile.c:363: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  ncfile.c:363: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  ncfile.c:364: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  ncfile.c:364: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  </code></pre>
  
  <p>In that block around line 363 and 364:</p>
  
  <pre><code>  for(i = 0; i &lt; ndimsp; i++) {
      char * temp_name;
      size_t temp_len;
      temp_name = (char *)malloc(sizeof(char) * 20);
      nc_inq_dim(cid, dimids[i], temp_name, &amp;temp_len);
      dimlens[i] = temp_len;
      if(dimids[i] == unlimdimidp) printf("\t\t%d %s   \tlength: %d (UNLIMITED)\n", i, temp_name, temp_len);
      else printf("\t\t%d %s   \tlength: %d\n", i, temp_name, temp_len);
      total_records *= temp_len;
      free(temp_name);
    }
  </code></pre>
  
  <p>What should I get rid of the warnings. It that harmful to the results?</p>
  
  <p>Thanks,</p>
  
  <p>Michael</p>