[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xalloc: missing prototype

From: Eric Blake
Subject: Re: xalloc: missing prototype
Date: Wed, 05 Dec 2012 09:19:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/05/2012 08:34 AM, Akim Demaille wrote:
> Hi friends,
> I can't compile Bison with GCC 4.3 and 4.4 (newer ones seem to
> be happy, I have not tried to understand why).

You may be hitting some of the problems with 'inline' that Paul has
recently been trying to fix, coupled with features lacking in older gcc.

> The attached patch fixes the issue.

I'm not sure if your patch is needed.  Remember, newer gcc understands
'#pragma GCC diagnostic push', but gcc 4.4 does not.

I have previously raised the issue, but the consensus at the time was
that you should not be enabling -Werror when using older gcc, and that
this particular warning set (-Wmissing-prototypes and
-Wmissing-declarations) is best silenced via pragma rather than
duplicated declarations.

What I have instead done in libvirt to allow compilation with older gcc
is the following:

    # Gnulib uses '#pragma GCC diagnostic push' to silence some
    # warnings, but older gcc doesn't support this.
    AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
      [lv_cv_gcc_pragma_push_works], [
      CFLAGS='-Wunknown-pragmas -Werror'
        #pragma GCC diagnostic push
        #pragma GCC diagnostic pop
    if test $lv_cv_gcc_pragma_push_works = no; then
      dontwarn="$dontwarn -Wmissing-prototypes"
      dontwarn="$dontwarn -Wmissing-declarations"

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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