From: Dmitry Antipov <dmantipov@yandex.ru>
To: Paul Eggert <eggert@cs.ucla.edu>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: #2 [Was: Re: Function attributes for make-docfile]
Date: Thu, 15 Jan 2015 06:27:44 +0300 [thread overview]
Message-ID: <54B733B0.7080009@yandex.ru> (raw)
In-Reply-To: <54B6C71A.1040101@cs.ucla.edu>
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
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
[-- Attachment #2: pragma_disable_warning.patch --]
[-- Type: text/x-diff, Size: 1472 bytes --]
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)
{
next prev parent reply other threads:[~2015-01-15 3:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-12 4:09 Function attributes for make-docfile Dmitry Antipov
2015-01-12 5:33 ` Stefan Monnier
2015-01-12 5:49 ` Paul Eggert
2015-01-12 12:28 ` #2 [Was: Re: Function attributes for make-docfile] Dmitry Antipov
2015-01-13 7:29 ` Paul Eggert
2015-01-13 10:21 ` Dmitry Antipov
2015-01-13 17:43 ` Paul Eggert
2015-01-13 19:45 ` Stefan Monnier
2015-01-13 23:26 ` Paul Eggert
2015-01-14 17:49 ` Stefan Monnier
2015-01-14 19:44 ` Paul Eggert
2015-01-15 3:27 ` Dmitry Antipov [this message]
2015-01-15 3:54 ` Dmitry Antipov
2015-01-15 5:33 ` Stefan Monnier
2015-01-16 4:50 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B733B0.7080009@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).