title: Why is GCC complaining about missing identifiers before a 'sizeof' that doesn't exist?
body: <p>I'm in the process of cross-compiling GTK+ 3.4.4 for Windows. I have already cross-compiled all of the build dependencies for GTK (ATK, Cairo, GDK Pixbuf, and Pango) and installed them to <code>/usr/i686-w64-mingw32/</code>.</p>
  
  <p>Attempting to compile GTK itself, however, results in the following error:</p>
  
  <pre><code>In file included from gdkrgba.c:31:0:
  fallback-c89.c:40:1: error: expected identifier or '(' before 'sizeof'
  fallback-c89.c:40:1: error: expected ')' before '==' token
  </code></pre>
  
  <p>Line 34 - 44 of <code>gdk/fallback-c89.c</code> contains:</p>
  
  <pre><code>34.  #ifndef HAVE_ISINF
  35.  /* Unfortunately MSVC does not have finite()
  36.   * but it does have _finite() which is the same
  37.   * as finite() except when x is a NaN
  38.   */
  39.  static inline gboolean
  40.  isinf (double x)
  41.  {
  42.      return (!_finite (x) &amp;&amp; !_isnan (x));
  43.  }
  44.  #endif
  </code></pre>
  
  <p>I haven't the slightest idea where GCC is finding '<code>sizeof</code>' or '<code>==</code>'. Why is the compiler throwing such a cryptic error message and how can I fix it?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> here is the actual command line:</p>
  
  <pre><code>/usr/bin/i686-w64-mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
    -DG_LOG_DOMAIN="Gdk" -DGDK_COMPILATION -I.. -I../gdk -I..
    -DG_DISABLE_CAST_CHECKS -mms-bitfields
    -I/usr/i686-w64-mingw32/include/pango-1.0
    -I/usr/i686-w64-mingw32/include/glib-2.0
    -I/usr/i686-w64-mingw32/lib/glib-2.0/include
    -I/usr/i686-w64-mingw32/include/cairo -I/usr/i686-w64-mingw32/include/pixman-1
    -I/usr/i686-w64-mingw32/include -I/usr/i686-w64-mingw32/include/freetype2
    -I/usr/i686-w64-mingw32/include/libpng15
    -I/usr/i686-w64-mingw32/include/gdk-pixbuf-2.0 -O2 -Wall -mms-bitfields -MT 
    gdkrgba.lo -MD -MP -MF .deps/gdkrgba.Tpo -c gdkrgba.c -DDLL_EXPORT -DPIC -o
    .libs/gdkrgba.o
  </code></pre>
  
  <hr>
  
  <p><strong>Further edit:</strong> after compiling with the <code>-E</code> option, I captured the following pre-processed output... which explains the strange <code>sizeof</code>:</p>
  
  <pre><code># 39 "fallback-c89.c"
  static inline gboolean
  ((sizeof (double x) == sizeof (float) ? __fpclassifyf (double x) : sizeof double x)) == (0x0100 | 0x0400))
  {
    return (!_finite (x) &amp;&amp; !_isnan (x));
  }
  </code></pre>
  
  <p>I can only conclude that <code>isinf</code> is already a defined macro. It is merely being expanded when used in the function declaration above.</p>
  
  <p>My question now becomes... why is <code>HAVE_ISINF</code> not defined? Is it a problem with the configure script?</p>
  
  <hr>
  
  <p><strong>Yet another edit:</strong> okay, so I decided to search for everything in the build tree that contained the string '<code>HAVE_ISINF</code>' and came across the following instances:</p>
  
  <ul>
  <li><p>autom4te.cache/traces.1</p>
  
  <pre><code>m4trace:configure.ac:740: -1- AH_OUTPUT([HAVE_ISINF], [/* Define to 1 if you
    have the `isinf\' function. */
  @%:@undef HAVE_ISINF])
  </code></pre></li>
  <li><p>config.h.in</p>
  
  <pre><code>/* Define to 1 if you have the `isinf' function. */
  #undef HAVE_ISINF
  </code></pre></li>
  <li><p>config.h</p>
  
  <pre><code>/* Define to 1 if you have the `isinf' function. */
  /* #undef HAVE_ISINF */
  </code></pre></li>
  </ul>
  
  <p>Surprisingly, there is nothing in <code>config.log</code> mentioning `HAVE_ISINF'.</p>
  
  <hr>
  
  <p><strong>(Possibly) final edit:</strong> I did some more investigation and found the string 'isinf' in <code>autom4te.cache/output.0</code> here: <a href="http://paste.ubuntu.com/1154478/" rel="nofollow">http://paste.ubuntu.com/1154478/</a></p>
  
  <p>This code made a reference to <code>ac_fn_c_check_func</code>, so I dug up the <a href="http://gcc.gnu.org/svn/gcc/branches/cilkplus/libcilkrts/configure" rel="nofollow">source for that function</a> and compiled <a href="http://paste.ubuntu.com/1154489/" rel="nofollow">the <code>.c</code> sample that the script generates</a>:</p>
  
  <pre><code>test.c:25:6: warning: conflicting types for built-in function ‘isinf’
    [enabled by default]
  /tmp/ccLYd1R8.o:test.c:(.text+0xc): undefined reference to `_isinf'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>This is odd since my explanation above would suggest that <code>isinf</code> is simply a macro.</p>