[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GL_LINK_WARNING
From: |
Bruno Haible |
Subject: |
Re: GL_LINK_WARNING |
Date: |
Thu, 17 Dec 2009 02:17:00 +0100 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
> +/* A compiler attribute is available in gcc versions 4.3.0 and later. */
> +# define _GL_WARN_ON_USE(function, message) \
> +extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
> +
> +# else /* Unsupported. */
> +# define _GL_WARN_ON_USE(function, message) \
> +typedef int _gl_warn_on_use
In ANSI C, but not in C99, it is an error to typedef the same type twice:
typedef int _gl_warn_on_use;
typedef int _gl_warn_on_use;
Therefore the last line is better changed to 'extern int _gl_warn_on_use'.
Actually one might consider to move the semicolon that terminates the
declaration into the expansion of _GL_WARN_ON_USE. Then, in the unsupported
case, the expansion of _GL_WARN_ON_USE(function, message) can be empty.
Bruno
- Re: fcntl for mingw, (continued)
- Re: GL_LINK_WARNING (was: fcntl for mingw), Bruno Haible, 2009/12/15
- Re: GL_LINK_WARNING, Eric Blake, 2009/12/15
- Re: GL_LINK_WARNING (was: fcntl for mingw), Eric Blake, 2009/12/16
- Re: GL_LINK_WARNING, Eric Blake, 2009/12/16
- Re: GL_LINK_WARNING,
Bruno Haible <=
- Re: GL_LINK_WARNING, Eric Blake, 2009/12/16
- Re: GL_LINK_WARNING, Bruno Haible, 2009/12/19
- Re: GL_LINK_WARNING, Jim Meyering, 2009/12/16
- va-args (was: GL_LINK_WARNING), Eric Blake, 2009/12/23