From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: GCC 7 warnings Date: Sat, 09 Sep 2017 19:16:25 +0300 Message-ID: <831snfx2xy.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1504973814 4464 195.159.176.226 (9 Sep 2017 16:16:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Sep 2017 16:16:54 +0000 (UTC) Cc: Richard Copley , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 09 18:16:44 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 1dqiQv-0000JJ-Ro for ged-emacs-devel@m.gmane.org; Sat, 09 Sep 2017 18:16:37 +0200 Original-Received: from localhost ([::1]:50191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqiR1-0003Al-EH for ged-emacs-devel@m.gmane.org; Sat, 09 Sep 2017 12:16:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqiQu-00039o-IM for emacs-devel@gnu.org; Sat, 09 Sep 2017 12:16:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqiQt-0005wI-Fd for emacs-devel@gnu.org; Sat, 09 Sep 2017 12:16:36 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqiQn-0005ty-TH; Sat, 09 Sep 2017 12:16:29 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1644 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dqiQm-0001Tf-D2; Sat, 09 Sep 2017 12:16:29 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:218069 Archived-At: In http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00151.html, Richard Copley sent a build log using GCC 7, which reveals several warnings I think are unrelated to MS-Windows. First, there are several warnings about fallthrough. Example: CC tparam.o tparam.c: In function 'tparam1': tparam.c:126:11: warning: this statement may fall through [-Wimplicit-fallthrough=] if (tem < 100) ^ tparam.c:128:6: note: here case '3': /* %3 means output in decimal, 3 digits. */ ^~~~ It turns out we use the -Wimplicit-fallthrough=5 GCC option, which rejects any previously supported fall-through comments, and instead insists on using __attribute__((fallthrough)), which triggers warnings in older versions of GCC. Paul, why do we use level 5 here, instead of using level 3, the default? Level 3 supports the /* FALLTHROUGH */ and similar comments that indicate a fall-through in a more portable way. We already have such comments in many places. I also see warnings in image.c: CC image.o In file included from image.c:33:0: image.c: In function 'xbm_scan': ../lib/c-ctype.h:185:3: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] switch (c) ^~~~~~ image.c:2577:17: note: 'c' was declared here unsigned char c; ^ image.c: In function 'gif_load': image.c:7902:24: warning: 'bgcolor' may be used uninitialized in this function [-Wmaybe-uninitialized] pixel_colors[i] = STRINGP (specified_bg) (There were a few more warnings which I fixed.) Thanks.