From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Emacs release branch warnings with GCC 8 Date: Mon, 30 Apr 2018 17:22:16 -0700 Organization: UCLA Computer Science Department Message-ID: References: <0d193e2f-bb41-ade7-fc31-5f353044f8cb@cs.ucla.edu> <83y3h4qybl.fsf@gnu.org> <83tvrsqxel.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6E8656442245C7D4D123F7A4" X-Trace: blaine.gmane.org 1525134059 18203 195.159.176.226 (1 May 2018 00:20:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 May 2018 00:20:59 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 01 02:20:55 2018 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 1fDJ2N-0004ba-6M for ged-emacs-devel@m.gmane.org; Tue, 01 May 2018 02:20:55 +0200 Original-Received: from localhost ([::1]:34289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDJ4S-0002zh-Ha for ged-emacs-devel@m.gmane.org; Mon, 30 Apr 2018 20:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDJ3n-0002zP-PG for emacs-devel@gnu.org; Mon, 30 Apr 2018 20:22:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDJ3m-0004xD-NN for emacs-devel@gnu.org; Mon, 30 Apr 2018 20:22:23 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDJ3i-0004vc-Sq; Mon, 30 Apr 2018 20:22:19 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4B35E16006A; Mon, 30 Apr 2018 17:22:17 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id N5Ddi5m7dm1O; Mon, 30 Apr 2018 17:22:16 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 664FC160081; Mon, 30 Apr 2018 17:22:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZGLN7dCv6LIR; Mon, 30 Apr 2018 17:22:16 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 474F016006A; Mon, 30 Apr 2018 17:22:16 -0700 (PDT) In-Reply-To: <83tvrsqxel.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 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:225001 Archived-At: This is a multi-part message in MIME format. --------------6E8656442245C7D4D123F7A4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 04/30/2018 12:58 PM, Eli Zaretskii wrote: > I'd prefer to leave -Wsuggest-attribute=malloc out on the release > branch, for now. OK, I installed the attached backport into the emacs-26 branch; it does the minimum to silence the diagnostics, without adding the new GCC 8 warning options. --------------6E8656442245C7D4D123F7A4 Content-Type: text/x-patch; name="0001-Port-enable-gcc-warnings-to-GCC-8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-enable-gcc-warnings-to-GCC-8.patch" >From 65ac27783a959a8339c2aab0f1e54d9b508a1f1f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 30 Apr 2018 17:17:11 -0700 Subject: [PATCH] Port --enable-gcc-warnings to GCC 8 Backport from master. * lib-src/emacsclient.c (fail): Do not dereference a null pointer. * src/frame.c (delete_frame): Add a decl with UNINIT to work around GCC bug 85563. * src/menu.h (finish_menu_items): Do not use attribute const. * src/regex.c (analyze_first): Use FALLTHROUGH, not a comment. --- lib-src/emacsclient.c | 2 +- src/frame.c | 1 + src/menu.h | 2 +- src/regex.c | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 574bec850f..b139b2fe3f 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -700,7 +700,7 @@ fail (void) { size_t extra_args_size = (main_argc - optind + 1) * sizeof (char *); size_t new_argv_size = extra_args_size; - char **new_argv = NULL; + char **new_argv = xmalloc (new_argv_size); char *s = xstrdup (alternate_editor); unsigned toks = 0; diff --git a/src/frame.c b/src/frame.c index cee775c6fa..0a6ca26f5d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1933,6 +1933,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) if (f == sf) { Lisp_Object tail; + Lisp_Object frame1 UNINIT; /* This line works around GCC bug 85563. */ eassume (CONSP (Vframe_list)); /* Look for another visible frame on the same terminal. diff --git a/src/menu.h b/src/menu.h index 4c4ac83424..1aa53f7454 100644 --- a/src/menu.h +++ b/src/menu.h @@ -30,7 +30,7 @@ enum { }; extern void init_menu_items (void); -extern void finish_menu_items (void) ATTRIBUTE_CONST; +extern void finish_menu_items (void); extern void discard_menu_items (void); extern void save_menu_items (void); extern bool parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object); diff --git a/src/regex.c b/src/regex.c index e8b99f6f02..4f9df68a9f 100644 --- a/src/regex.c +++ b/src/regex.c @@ -4038,8 +4038,7 @@ analyze_first (const_re_char *p, const_re_char *pend, char *fastmap, }; /* Keep `p1' to allow the `on_failure_jump' we are jumping to to jump back to "just after here". */ - /* Fallthrough */ - + FALLTHROUGH; case on_failure_jump: case on_failure_keep_string_jump: case on_failure_jump_nastyloop: -- 2.17.0 --------------6E8656442245C7D4D123F7A4--