From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: #2 [Was: Re: Function attributes for make-docfile] Date: Thu, 15 Jan 2015 06:27:44 +0300 Message-ID: <54B733B0.7080009@yandex.ru> References: <54B348E8.7080203@yandex.ru> <54B3604E.9020304@cs.ucla.edu> <54B3BDE3.8030602@yandex.ru> <54B4C971.7010209@cs.ucla.edu> <54B5A991.8010509@cs.ucla.edu> <54B6C71A.1040101@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080309040006010803050002" X-Trace: ger.gmane.org 1421292490 11697 80.91.229.3 (15 Jan 2015 03:28:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2015 03:28:10 +0000 (UTC) Cc: Emacs development discussions To: Paul Eggert , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 15 04:28:04 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBb6H-0007ft-02 for ged-emacs-devel@m.gmane.org; Thu, 15 Jan 2015 04:28:01 +0100 Original-Received: from localhost ([::1]:48927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBb6G-0003MV-Cc for ged-emacs-devel@m.gmane.org; Wed, 14 Jan 2015 22:28:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBb6D-0003MP-Hx for emacs-devel@gnu.org; Wed, 14 Jan 2015 22:27:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBb68-0002eZ-HR for emacs-devel@gnu.org; Wed, 14 Jan 2015 22:27:57 -0500 Original-Received: from forward3h.cmail.yandex.net ([87.250.230.18]:42919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBb67-0002dg-Vw for emacs-devel@gnu.org; Wed, 14 Jan 2015 22:27:52 -0500 Original-Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [37.140.190.27]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id 16B2C1639; Thu, 15 Jan 2015 06:27:46 +0300 (MSK) Original-Received: from smtp2o.mail.yandex.net (localhost [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id A775A36A2ED0; Thu, 15 Jan 2015 06:27:45 +0300 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yP5pd7DnsD-RiTGDZAk; Thu, 15 Jan 2015 06:27:44 +0300 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1421292464; bh=2hStsYy/6mSZdEAyvN/kkdZXLFJ3Hkg6LqXFjRhFvZU=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=DXO7dvnLvCad7ADYR7cxOZdG4BAhg0tD7rf8zIF0Qc+qZN5k2+9av6PBQVB3o1DMl +ds9okNkGQKQtQHv/BEfj45C93EOqEQOumruA44iZwGz3jPfgB9xrCnaVbqBOPYU27 d9NGh6Ypz8WHDYVhwhCLl1uiyKk7uEglIMpUxX0s= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: <54B6C71A.1040101@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 87.250.230.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181272 Archived-At: This is a multi-part message in MIME format. --------------080309040006010803050002 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 01/14/2015 10:44 PM, Paul Eggert wrote: > There are several possibilities for how to fix this in a less-ugly way, including: > > 1. Omit -Wsuggest-attribute=const. > > 2. Omit -Wredundant-decls. > > 3. Make make-docfile.c even smarter and/or trickier. 2) was added to cleanup global namespace, which is typically polluted in mature projects, and I think this is still useful. Why not use #pragma in the way similar to bytecode.c? IMO local ugliness is always better than the global one :-). Dmitry --------------080309040006010803050002 Content-Type: text/x-diff; name="pragma_disable_warning.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pragma_disable_warning.patch" diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 741fa4b..79d421a 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -729,18 +729,6 @@ write_globals (void) if (globals[i].flags & DEFUN_const) fputs (" ATTRIBUTE_CONST", stdout); - else if (strcmp (globals[i].name, "Fnext_read_file_uses_dialog_p") - == 0) - { - /* It would be nice to have a cleaner way to deal with this - special hack. */ - fputs (("\n" - "#if ! (defined USE_GTK || defined USE_MOTIF \\\n" - " || defined HAVE_NS || defined HAVE_NTGUI)\n" - "\tATTRIBUTE_CONST\n" - "#endif\n"), - stdout); - } puts (";"); } diff --git a/src/fileio.c b/src/fileio.c index 6c443c9..31b117b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5736,6 +5736,11 @@ then any auto-save counts as "recent". */) /* Reading and completing file names. */ +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, Snext_read_file_uses_dialog_p, 0, 0, 0, doc: /* Return t if a call to `read-file-name' will use a dialog. @@ -5754,6 +5759,10 @@ before any other event (mouse or keypress) is handled. */) return Qnil; } +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# pragma GCC diagnostic pop +#endif + void init_fileio (void) { --------------080309040006010803050002--