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: Sun, 21 May 2017 20:00:11 +0000 Message-ID: References: <20170518202450.75747-1-phst@google.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113b00d85c4c5605500e347b" X-Trace: blaine.gmane.org 1495396833 2099 195.159.176.226 (21 May 2017 20:00:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 May 2017 20:00:33 +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 Sun May 21 22:00:27 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 1dCX1c-0000OO-I1 for ged-emacs-devel@m.gmane.org; Sun, 21 May 2017 22:00:24 +0200 Original-Received: from localhost ([::1]:39161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCX1h-000573-Rq for ged-emacs-devel@m.gmane.org; Sun, 21 May 2017 16:00:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCX1b-00056w-L9 for emacs-devel@gnu.org; Sun, 21 May 2017 16:00:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCX1a-0003cB-Qg for emacs-devel@gnu.org; Sun, 21 May 2017 16:00:23 -0400 Original-Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:33209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCX1a-0003c4-KA for emacs-devel@gnu.org; Sun, 21 May 2017 16:00:22 -0400 Original-Received: by mail-oi0-x235.google.com with SMTP id w10so140433839oif.0 for ; Sun, 21 May 2017 13:00:22 -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; bh=1hMWjejmyAmdAMMlv0rLyDFeUUNhbgwTDWQ+I4NyW8o=; b=PKtqtJqtURTuZmos5lY7WJ4nxUb7Zz1J+Hpy1e6ZVMdhl/4igP9dIaXXSvThYCEkmx 9YPmB32mpAaHTaw+J10Pe/449POsI0n2O0lfnXIRho28C6EsvbwHlOQv3q/xRynPylL8 Ng13sJUhIDcezKadbUR8SBtpVp3cah5fHDG8EzlAH0RgHTqhCz1W/n94868PkKk2aFeU 9QotRcp1si8wgkNsGS9A35m766rapZYUJyEVk9C58WVuAoN3WZ1g/kjZRhBLM2CTB1vA tTyUEDNtNmXk8ymFawU44sYnbaAfYYQua0P8WbV010yTx2vgvzcZuOc0F723CRAvpRio 32/A== 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=1hMWjejmyAmdAMMlv0rLyDFeUUNhbgwTDWQ+I4NyW8o=; b=p8xAp2kpa/ybIVIkEHR7khtpcfh2zZtyoJNCNrRv10wim2ZJYqvkGNsYdhjVw/ssVH jdlxeZp4deli/cRuwEufSZ8+MraUc9Qmtt78JvKyka60YawLhvln5wl/uUmHw1wZoGjs pf374HaS0jEBLpJTwHU7FFYqRkjTutlVfSS6h4dRPoUiQfX++G7vupJe1VkCyAOJVwYc ggckupLcRoPFo1A2AcdPBqY6w0OchS1OAFrOCBt4VNgYbB3h0vOboRYkMIywqgKO1/RD 9xYpaycVRwfuCIX9pALQGxs6/y3rf/ncpj3HT0UXOVc0l/5VY4ddr3zM8a0dUHQgPwYE SpHQ== X-Gm-Message-State: AODbwcBr/lg8YjJZGruJqT6VIhC40vLsTG4wN3h1EZGUSdYEoXyN9LMg gEpp0QV2IahUI83R3i259RqWx4Fvtw== X-Received: by 10.202.80.203 with SMTP id e194mr11097964oib.155.1495396821780; Sun, 21 May 2017 13:00:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::235 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:215063 Archived-At: --001a113b00d85c4c5605500e347b Content-Type: text/plain; charset="UTF-8" Paul Eggert schrieb am So., 21. Mai 2017 um 08:07 Uhr: > On 05/19/2017 02:31 AM, Philipp Stephani wrote: > > Apparently on some systems mbstate_t is a nested struct, and the compiler > > warns about missing braces. Note that memset to initialize a mbstate_t is > > explicitly recommended in the libc manual: > > Yes, of course memset works (which is all that the glibc manual really > says). > It's just that it's verbose and the verbosity isn't needed. > > I guess the problem here is that clang's -Wmissing-braces option generates > false > alarms. The Clang folks may fix that someday. In the meantime I installed > the > first attached patch, to turn off that option for Clang. > This apparently hasn't worked, at least I still get the warning, and there's no -Wno-missing-braces in WARN_CFLAGS. For Clang, it'd probably be better to use -Weverything and then disable individual warnings with -Wno... instead of checking for the existence of every warning flag. That would make configure runs faster and the command line shorter. --001a113b00d85c4c5605500e347b 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 08:07=C2=A0Uhr:
On 05/19/2017 02:31 AM, Philipp Stephani wrote:
> Apparently on some systems mbstate_t is a nested struct, and the compi= ler
> warns about missing braces. Note that memset to initialize a mbstate_t= is
> explicitly recommended in the libc manual:

Yes, of course memset works (which is all that the glibc manual really says= ).
It's just that it's verbose and the verbosity isn't needed.

I guess the problem here is that clang's -Wmissing-braces option genera= tes false
alarms. The Clang folks may fix that someday. In the meantime I installed t= he
first attached patch, to turn off that option for Clang.

This apparently hasn't worked, at least I still get t= he warning, and there's no -Wno-missing-braces in WARN_CFLAGS.
For Clang, it'd probably be better to use -Weverything and then disab= le individual warnings with -Wno... instead of checking for the existence o= f every warning flag. That would make configure runs faster and the command= line shorter.
--001a113b00d85c4c5605500e347b--