On Tue, 10 Feb 2015, Marek Polacek wrote:

> +<p>Several new warnings have been added to the C front end.  One of the new
> +warnings is that GCC now warns about non-standard predefined macros with the
> +<code>-Wpedantic</code> option.  For instance:</p>
> +
> +<pre><code>
> +  void
> +  foo (void)
> +  {
> +    const char *s = __FUNCTION__;
> +  }
> +</code></pre>
> +
> +<pre>
> +<b>q.c:4:19:</b> <b style='color:magenta'>warning:</b> ISO C does not 
> support <b>'__FUNCTION__'</b> predefined identifier [-Wpedantic]
> +  const char *s = __FUNCTION__;
> +                  <b style='color:lime'>^</b>
> +</pre>
> +
> +<p>The fix is either to use the standard predefined macro 
> <code>__func__</code>
> +(since C99), or to use the <code>__extension__</code> keyword:<p/>

__FUNCTION__ and __func__ aren't macros (essentially they're built-in 
variables).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to