From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Silence two Clang warnings Date: Thu, 15 Jun 2017 13:11:33 +0000 Message-ID: References: <1e61fe6d-4646-b2ea-9dc1-7b782fc91e05@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1136f5c8170e2d0551ff6907" X-Trace: blaine.gmane.org 1497532404 12459 195.159.176.226 (15 Jun 2017 13:13:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 13:13:24 +0000 (UTC) Cc: Emacs development discussions To: Paul Eggert , Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 15 15:13:17 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLUaL-0002rW-8c for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 15:13:17 +0200 Original-Received: from localhost ([::1]:54041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLUaQ-0001lC-DC for ged-emacs-devel@m.gmane.org; Thu, 15 Jun 2017 09:13:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLUYs-0000wF-T9 for emacs-devel@gnu.org; Thu, 15 Jun 2017 09:11:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLUYr-0001x8-Us for emacs-devel@gnu.org; Thu, 15 Jun 2017 09:11:46 -0400 Original-Received: from mail-ot0-x229.google.com ([2607:f8b0:4003:c0f::229]:33875) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLUYr-0001wv-Q1 for emacs-devel@gnu.org; Thu, 15 Jun 2017 09:11:45 -0400 Original-Received: by mail-ot0-x229.google.com with SMTP id r67so9356273ota.1 for ; Thu, 15 Jun 2017 06:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KOcszg1oJT14BdzsnhyNP/du2FN+2bJWh+dn6Fkd/Ew=; b=cAPnvSzCOkb2Sx1f0zq2jSqVAq6lWehI6TqvrDg195tHTRWfA40oGis36w4mV8WI35 LOJeghVmMun0vKPxP+hqShrOMQsXQwTf1Vk0HhhRq+oHP1mEKmz+EcDQGXrSwqt1TiVP BU3Zo0NVHIPpnKxZ9GDbg3p9M2LAUMNWddNHZ0Z1SCS87unB42CJJVJ/98BYyeORpWS1 qvBfDfkoBIT4XtNNAq8J/6hgaOk+i54TWMjWW6u7FWEkq6GNM0X29LDZhQVbckEPY+4w SxhLpU4qzwRg4UxCRC4kSC+Og1CmCqteL6eevF7r7ZPWAXCRdq1KYWJHWliMtKfB5RhD z7DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KOcszg1oJT14BdzsnhyNP/du2FN+2bJWh+dn6Fkd/Ew=; b=SY1KivFGLNjmqGNamRCU/bRWMj9yQHCatB9yQP6VS8q7CaZgA6T4Cyppiv0oCA0/xH abu0YLlWxomuiDfiGuIEBRpCZf/HjMHE3DqrYADE2EGO43SMPYpCoe3MWgv/i+WCZquG ZWWzrHI0Q2/2ia1EBUl+K0Us8okuEPKEzGlWOpG+wZBflaWCO+tKGm+EnYHevtQm69aL +5qT/bSx5nh9Wm1bPvXsNGR5qA4doDfFq9dk/rKPqeNj1GGajsT8pbdu1vGvlgHa24Cy oVVxpLNFY48XjgVNMym7RlDP5vI8cWVbSY8judDVpAgHxjr88BxvnIsU09plVh+/kelT gExA== X-Gm-Message-State: AKS2vOxBB4LWKbBZZAxRE8oB4e8Dwc87LVys6eyvNUQfayPC4i5k3xmm VYn+lt3RhJr2kJ7gQDmobKgQ+bftaA== X-Received: by 10.157.30.129 with SMTP id n1mr2739537otn.243.1497532305177; Thu, 15 Jun 2017 06:11:45 -0700 (PDT) In-Reply-To: <1e61fe6d-4646-b2ea-9dc1-7b782fc91e05@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215639 Archived-At: --001a1136f5c8170e2d0551ff6907 Content-Type: text/plain; charset="UTF-8" Paul Eggert schrieb am Di., 13. Juni 2017 um 22:44 Uhr: > Part of the attached patch, recently installed into master, would be > automatically reverted the next time we merged from gnulib, since > strftime.c is copied from Gnulib. I'm not getting a warning when > compiling with Clang, so I'm puzzled as to why the patch was needed. > Here's how I build (on Fedora 25): > > ./configure --enable-gcc-warnings CC=clang > > Fedora 25 is running clang version 3.9.1 (tags/RELEASE_391/final). > I get this on macOS with -O3 and -enable-gcc-warnings, using Apple's fork of Clang (i.e. the default system compiler). > > Background: I would rather avoid the need for this sort of patch, as we > shouldn't have to complicate the code just to pacify a Clang false > alarm. If an older Clang is generating a false alarm, let's just ignore > the diagnostic. If it's a newer Clang, let's change the options to Clang > to suppress the diagnostic. > > I'd prefer to not suppress the diagnostic globally, because these warnings are generally useful in other places. Would you accept introducing pragmas to temporarily disable the warnings in Clang (#pragma clang diagnostic push/ignore/pop), with an explanation why they are false positives in these cases? --001a1136f5c8170e2d0551ff6907 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am Di., 13. Juni 2017 um 22:44=C2=A0Uhr:
Part of the attached patch, recently installed into master, w= ould be
automatically reverted the next time we merged from gnulib, since
strftime.c is copied from Gnulib. I'm not getting a warning when
compiling with Clang, so I'm puzzled as to why the patch was needed. Here's how I build (on Fedora 25):

./configure --enable-gcc-warnings CC=3Dclang

Fedora 25 is running clang version 3.9.1 (tags/RELEASE_391/final).

I get this on macOS with -O3 and -enable-gcc-wa= rnings, using Apple's fork of Clang (i.e. the default system compiler).=
=C2=A0

Background: I would rather avoid the need for this sort of patch, as we
shouldn't have to complicate the code just to pacify a Clang false
alarm. If an older Clang is generating a false alarm, let's just ignore=
the diagnostic. If it's a newer Clang, let's change the options to = Clang
to suppress the diagnostic.


I'd prefer to not suppress the dia= gnostic globally, because these warnings are generally useful in other plac= es.
Would you accept introducing pragmas to temporarily disable t= he warnings in Clang (#pragma clang diagnostic push/ignore/pop), with an ex= planation why they are false positives in these cases?=C2=A0
--001a1136f5c8170e2d0551ff6907--