bug-gnulib
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]