title: GCC compile warning: format ‘%i’ expects argument of type ‘int *’, but argument 2 has type ‘enum month *’ [-Wformat]
body: <p>I get the following warning when I try to compile the code:</p>
  
  <p>program141.c:13:5: warning: format ‘%i’ expects argument of type ‘int *’, but argument 2 has type ‘enum month *’ [-Wformat]</p>
  
  <pre><code>// Program to print the number of days in a month
  
  #include &lt;stdio.h&gt;
  
  int main (void)
  {
      enum month { january = 1, february, march, april, may, june,
           july, august, september, october, november, december };
      enum month aMonth;
      int        days;
  
      printf ("Enter month number: ");
      scanf ("%i", &amp;aMonth);
  
      switch (aMonth) {
      case january:
      case march:
      case may:
      case july:
      case august:
      case october:
      case december:
          days = 31;
          break;
      case april:
      case june:
      case september:
      case november:
          days = 30;
          break;
      case february:
          days = 28;
          break;
      default:
          printf ("bad month number\n");
          days = 0;
          break;
      }
  
      if ( days != 0 )
      printf ("Number of days is %i\n", days);
  
      if ( aMonth == february )
      printf ("...or 29 if it's a leap year\n");
  
      return 0;
  }
  </code></pre>
  
  <p>This code is from a book I'm reading.</p>
  
  <p>How do I fix this warning?</p>