title: Cannot Use Printf!?! (while performing hashing algorithm using mhash)
body: <p>I am using Mhash and I would like to print the length of my blocksize for debugging purposes, but I keep getting an error every time I try to compile</p>
  
  <p>Any suggestions on how I can fix this error?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;mhash.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  // 0x12e6bc6e68c3b9506e6668db6b7224f894fab073728fc179 (TIGER192) (48)
  
   int main()
   {
          char password[] = "Jefe";
          int keylen = 4; 
          char data[] = "what do ya want for nothing?";
          int datalen = 28;
          MHASH td, td2;
          unsigned char *mac, *mac2;
          int i, j;
  
      td = mhash_hmac_init(MHASH_TIGER192, password, keylen, mhash_get_hash_pblock(MHASH_TIGER192));
  
          mhash(td, data, datalen); 
          mac = mhash_hmac_end(td); 
  
          printf("0x");
          for (i = 0; i &lt; mhash_get_block_size(MHASH_TIGER192); i++)
      {
                  printf("%.2x", mac[i]);
          }
          printf("\n");
  
      // int length = strlen(mac);
      // printf(length);
  
      // int length = 5;
      // printf(length);
  
          exit(0);
   }
  
  I run the program with the following commands:
  hb2@hb1:~/Desktop$ gcc -o hashexample hashexample.c -lmhash
  hb2@hb1:~/Desktop$ ./hashexample
  0x12e6bc6e68c3b9506e6668db6b7224f894fab073728fc179
  </code></pre>
  
  <p>And it runs successfully, but when I try to print the length of the hashed result, I get the following error!!? Any ideas on why?</p>
  
  <pre><code>// int length = strlen(mac);
  // printf(length);
  
  hb2@hb1:~/Desktop$ gcc -o hashexample hashexample.c -lmhash
  hashexample.c: In function ‘main’:
  hashexample.c:33:2: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [enabled by default]
  /usr/include/stdio.h:363:12: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
  hashexample.c:33:2: warning: format not a string literal and no format arguments [-Wformat-security]
  </code></pre>
  
  <p>At first, I thought it was because I thought I was using strlen incorrectly?! But even when I try to do a simple printf of an integer, I still get an error:</p>
  
  <pre><code>// int length = 5;
  // printf(length);
  
  hb2@hb1:~/Desktop$ gcc -o hashexample hashexample.c -lmhash
  hashexample.c: In function ‘main’:
  hashexample.c:35:2: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [enabled by default]
  /usr/include/stdio.h:363:12: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
  hashexample.c:35:2: warning: format not a string literal and no format arguments [-Wformat-security]
  </code></pre>
  
  <p>Thanks for your help in advance!</p>