From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net
X-Spam-Level:
X-Spam-ASN: AS3215 2.0.0.0/16
X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00 shortcircuit=no
autolearn=ham autolearn_force=no version=3.4.0
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1XTvGJ-0003eV-4G
for mharc-bug-gnulib@gnu.org; Tue, 16 Sep 2014 12:05:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51284)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from
) id 1XTvGC-0003dj-CG
for bug-gnulib@gnu.org; Tue, 16 Sep 2014 12:05:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from
) id 1XTvG7-0002JE-9p
for bug-gnulib@gnu.org; Tue, 16 Sep 2014 12:05:44 -0400
Received: from mx1.redhat.com ([209.132.183.28]:12424)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from
) id 1XTvG6-0002Gf-Lx
for bug-gnulib@gnu.org; Tue, 16 Sep 2014 12:05:39 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8GG5Pd2008115
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256
verify=FAIL); Tue, 16 Sep 2014 12:05:25 -0400
Received: from [10.36.116.100] (ovpn-116-100.ams2.redhat.com [10.36.116.100])
by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with
ESMTP id s8GG5Mm5029822
(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
Tue, 16 Sep 2014 12:05:24 -0400
Message-ID: <54185FC2.1090006@draigBrady.com>
Date: Tue, 16 Sep 2014 17:05:22 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?=
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
To: Dylan Cali
Subject: Re: compile warnings when including avltree-list and gcc-warnings
is enabled
References:
<5409DBEA.8010006@cs.ucla.edu>
<540BA72D.1000904@cs.ucla.edu>
<540DBCD0.4070607@redhat.com>
In-Reply-To:
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
s8GG5Pd2008115
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 209.132.183.28
Cc: bug-gnulib@gnu.org, Paul Eggert ,
Eric Blake
X-BeenThere: bug-gnulib@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Gnulib discussion list
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 16 Sep 2014 16:05:49 -0000
On 09/09/2014 12:09 AM, Dylan Cali wrote:
> On Mon, Sep 8, 2014 at 10:04 AM, Dylan Cali wrote=
:
>> On Sep 8, 2014 9:27 AM, "Eric Blake" wrote:
>>> Does this work for all supported versions of gcc? Or do you need to m=
ake
>>> it conditional on new enough gcc (it's okay if warnings have to be
>>> disabled to compile with older gcc, but not okay if the way to disabl=
e
>>> warnings for newer gcc causes compilation failure in older gcc).
>>
>> Yep you're right, looking at some other code of mine I have a conditio=
nal
>> checking for gcc > 3.7 before doing the push/pop, so it looks like tha=
t is
>> the min version for this pragma. So wrap the pragma in a conditional,=
and
>> add a conditional in the Makefile turning off warnings altogether for =
gcc <=3D
>> 3.7?
>=20
> Ok cool, it looks like this is mostly already implemented. First, I
> was wrong about the version of gcc that supports these pragmas, it's
> 4.6 [1]. And gnulib already uses the diagnostic pragmas elsewhere, so
> I mimicked the conditional format used in other files. Finally, the
> makefile conditional is already done in the coreutils configure.ac
> [2].
>=20
> I've attached a patch with the updates, let me know if you see any
> further issues.
>=20
> Thanks,
> Dylan
>=20
> [1] https://gcc.gnu.org/ml/gcc-help/2011-01/msg00113.html
> [2] https://github.com/coreutils/coreutils/blob/master/configure.ac#L97
I don't think we need to worry about the pragma as it was a valid warning=
in this case.
To tell the compiler we want to discard the result in this context
we can use ignore_value() or the more appropriate (void) cast in this cas=
e.
Also it's best to leave the prototype in the tests.
I've adjusted and pushed your patch accordingly at:
http://git.sv.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dcommitdiff;h=3D5549ef8
thanks!
P=E1draig.
p.s. It's marked trivial for licensing reasons.