From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Warnings in mingw64 builds on master Date: Sat, 15 Aug 2020 22:36:12 +0200 Message-ID: <875z9jtznn.fsf@telefonica.net> References: <864kp47t20.fsf@gmail.com> <83a6yvkhby.fsf@gnu.org> <86v9hj7njb.fsf@gmail.com> <83tux3ive9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27572"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:mGetam1OYG3YK1uFBmski51Hv0k= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 15 22:36:56 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k72vA-00076K-Kf for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Aug 2020 22:36:56 +0200 Original-Received: from localhost ([::1]:33514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k72v9-00037X-MZ for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Aug 2020 16:36:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k72ub-0002Mr-Cg for emacs-devel@gnu.org; Sat, 15 Aug 2020 16:36:21 -0400 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:43678 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k72uZ-0001By-N4 for emacs-devel@gnu.org; Sat, 15 Aug 2020 16:36:21 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1k72uW-0006TG-RP for emacs-devel@gnu.org; Sat, 15 Aug 2020 22:36:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/15 02:23:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253826 Archived-At: Eli Zaretskii writes: >> From: Andy Moreton >> Date: Sat, 15 Aug 2020 19:48:56 +0100 >> >> >> C:/emacs/git/emacs/master/src/w32reg.c:146:1: warning: function might be >> >> candidate for attribute 'malloc' [-Wsuggest-attribute=malloc] >> >> 146 | w32_get_string_resource (void *v_rdb, const char *name, const char *class) >> >> | ^~~~~~~~~~~~~~~~~~~~~~~ >> > >> > That's just noise. There's nothing wrong with the code. >> >> Agreed. However it is better to have a clean build than to have >> pointless warnings, so the real errors stand out. > > I'd rather we removed -Wsuggest-attribute=malloc from the options we > use. >> >> C:/emacs/git/emacs/master/src/w32.c: In function '_sys_read_ahead': >> >> C:/emacs/git/emacs/master/src/w32.c:8785:10: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized] >> >> 8785 | if (rc == sizeof (char)) >> >> | ~~~^~~~~~~~~~~~~~~~ >> > >> > This is a bug in the compiler you are using: rc _is_ initialized. >> >> The is "gcc version 10.2.0 (Rev1, Built by MSYS2 project)" so not >> exactly old. > > Let's hope GCC 10.3 will fix this. I'm half-asleep, so excuse me if I'm missing the obvious... but rc is assigned or its address taken within conditional blocks, so if none of those conditions are true, rc is not initialized at the warning site.