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: [PATCH] Clean up a couple of compiler warnings Date: Tue, 23 May 2017 10:17:30 +0000 Message-ID: References: <20170518202450.75747-1-phst@google.com> <7631cb49-7940-7758-9ec3-5530e0ab542e@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113f45a23e7f0a05502e4ca5" X-Trace: blaine.gmane.org 1495534704 13791 195.159.176.226 (23 May 2017 10:18:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 May 2017 10:18:24 +0000 (UTC) To: Paul Eggert , Philipp Stephani , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 23 12:18:18 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 1dD6tM-0003Ow-N8 for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 12:18:16 +0200 Original-Received: from localhost ([::1]:47374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD6tS-00031z-2L for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 06:18:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dD6sq-00031r-7a for emacs-devel@gnu.org; Tue, 23 May 2017 06:17:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dD6sp-0008Uj-2w for emacs-devel@gnu.org; Tue, 23 May 2017 06:17:44 -0400 Original-Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:34044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dD6so-0008S2-Sj for emacs-devel@gnu.org; Tue, 23 May 2017 06:17:43 -0400 Original-Received: by mail-qt0-x22d.google.com with SMTP id c13so123368033qtc.1 for ; Tue, 23 May 2017 03:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xs43G9PhvevbdUO2vlnZSujcdTIMgHlJVmZmbxwrrKk=; b=SFIZM6uuLxftOvJrK/i2L37eMY0iBuNtJTLjpLbfkVGG/58VLXCnn1VXZCnjMa0Hy7 EOQpzoVjUqPR2fZ7o0/SwCdqUGjOmSNRWaLq6JjHusGCWa6/7Z0hAtcV5PmSWU82h7VB SqGkRkKOfgodedMDARPTqCx+TWLaR1cAGzk+ub1x+p13SG4BVH4SdRCtySJG3zskSoRp IKIMou3VkZHsjuppJCS31HMlMAGX+072fVPUBgt7Y8UOzSzS2A1ytzqJorVIMdCbbr95 pHjzrRQLFAEgUEkdcmvzRUIrW9Q7NkY2iHJmnhz1jSiZZNmVQFH2zaU5a8dwikCIZ3km CRXA== 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; bh=xs43G9PhvevbdUO2vlnZSujcdTIMgHlJVmZmbxwrrKk=; b=uEMYKJfN8hAcpCmf/TGP7rFrudBA8PXkeUHrlraLERJT8sllD3387+DUgZV4qfjna+ vMykGgqixOnu3y1cKxt8f1RXmnVp0NBcdvpBIvAsrMIjULcXiyZbXzncoic7hYAiqtnY U6U7MsuJjTUqLSkS1lXix4g3xOm7FRbUFWPq17i+K9bHwzEA3uikj+duMoD0n/3xMvI+ VKbOHrNyXw1njFc789+aPQ+jD6kjdwMNXhQL8O11x1KXEr+5ZHG6dPNTQ7oEju9wUzpH Jfe5Ev+0/wJaVjql8535eI3/HKNj9vGqFR5p2vHpovkxgU/soVtvxdyRPsmLRbNFpBkq 0zGA== X-Gm-Message-State: AODbwcBVTOB6TBV91/hZGvF5rkCr/W4W0gUZCx1XPkLmp/7/QLX6wGT9 ktAgeH3FSG+Z59v3H6/byA7R3ysGsNPs X-Received: by 10.237.37.55 with SMTP id v52mr28531917qtc.31.1495534661382; Tue, 23 May 2017 03:17:41 -0700 (PDT) In-Reply-To: <7631cb49-7940-7758-9ec3-5530e0ab542e@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22d 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:215125 Archived-At: --001a113f45a23e7f0a05502e4ca5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Paul Eggert schrieb am So., 21. Mai 2017 um 22:33 Uhr: > Philipp Stephani wrote: > > This apparently hasn't worked, at least I still get the warning, and > > there's no -Wno-missing-braces in WARN_CFLAGS. > > My change didn't add -Wno-missing-braces; it removed -Wmissing-braces. Th= is > sufficed for Fedora 25 x86-64, which has clang 3.9.1. > > Perhaps you're running a different version of Clang, which is pickier? If > so, > you might try the attached patch; if it works, please feel free to instal= l > it. > I haven't tested it, but I'm pretty sure that adding -Wno-missing-braces should work. The warnings enabled for -Wall and -Wextra change from version to version, so only leaving out -W... will often not be enough, it would be more future-proof to explicitly specify -Wno... in all cases. > > > For Clang, it'd probably be better to use -Weverything and then disable > > individual warnings with -Wno > > I'd rather not spend a lot of time worrying about warnings generated by > compilers other than recent GCC, as there are too many compilers and too > many > false alarms and it's not worth the hassle. But in practice, at least on Unix-like systems, only GCC and Clang matter, and Clang is the primary and often the only compiler on systems such as FreeBSD and macOS. > If you'd like to take up the burden > of pacifying Clang with tricks like the above, though, that should be > fine, as > long as it doesn't burden maintenance for the rest of us. If not, and if > Clang > continues to be a hassle, we can avoid much of the hassle by disabling > warnings > by default when the compiler is Clang. > It's not a trick. If you don't want the warning FOO to be shown, pass -Wno-FOO. That should work consistently for both compilers and all versions. --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks. --001a113f45a23e7f0a05502e4ca5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am So., 21. Mai 2017 um 22:33=C2=A0Uhr:
Philipp Stephani wrote:
> This apparently hasn't worked, at least I still get the warning, a= nd
> there's no -Wno-missing-braces in WARN_CFLAGS.

My change didn't add -Wno-missing-braces; it removed -Wmissing-braces. = This
sufficed for Fedora 25 x86-64, which has clang 3.9.1.

Perhaps you're running a different version of Clang, which is pickier? = If so,
you might try the attached patch; if it works, please feel free to install = it.

I haven't tested it, but I'= m pretty sure that adding -Wno-missing-braces should work.
The wa= rnings enabled for -Wall and -Wextra change from version to version, so onl= y leaving out -W... will often not be enough, it would be more future-proof= to explicitly specify -Wno... in all cases.
=C2=A0

> For Clang, it'd probably be better to use -Weverything and then di= sable
> individual warnings with -Wno

I'd rather not spend a lot of time worrying about warnings generated by=
compilers other than recent GCC, as there are too many compilers and too ma= ny
false alarms and it's not worth the hassle.

=
But in practice, at least on Unix-like systems, only GCC and Clang mat= ter, and Clang is the primary and often the only compiler on systems such a= s FreeBSD and macOS.
=C2=A0
= If you'd like to take up the burden
of pacifying Clang with tricks like the above, though, that should be fine,= as
long as it doesn't burden maintenance for the rest of us. If not, and i= f Clang
continues to be a hassle, we can avoid much of the hassle by disabling warn= ings
by default when the compiler is Clang.

= It's not a trick. If you don't want the warning FOO to be shown, pa= ss -Wno-FOO. That should work consistently for both compilers and all versi= ons.=C2=A0
--

Google Germany GmbH<= br> Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Ad= ressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absen= der und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank.

This e-mail is confidential. If you are not the right addres= see please do not forward it, please inform the sender, and please erase th= is e-mail including any attachments. Thanks.

--001a113f45a23e7f0a05502e4ca5--