aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-01-15 20:37:05 -0800
committerPaul Eggert2015-01-15 20:37:44 -0800
commit0adc75af1833cd46aab339ce7f1ca5d6919c70af (patch)
treefb4bc7c0172c31f8313bbde3dabe4ef9bf5fe07e
parent255d2a5a53083d676977023e9772d97095c6db46 (diff)
downloademacs-0adc75af1833cd46aab339ce7f1ca5d6919c70af.tar.gz
emacs-0adc75af1833cd46aab339ce7f1ca5d6919c70af.zip
Give up on -Wsuggest-attribute=const
The attribute doesn't help performance significantly, and the warning seems to be more trouble than it's worth. See the thread at: http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00361.html * configure.ac (WERROR_CFLAGS): Don't use -Wsuggest-attribute=const. * lib-src/make-docfile.c (write_globals): Remove special hack for Fnext_read_file_uses_dialog_p. * src/decompress.c (Fzlib_available_p): * src/gnutls.c (Fgnutls_available_p): * src/gtkutil.h (xg_uses_old_file_dialog): * src/xdisp.c (Ftool_bar_height): * src/xmenu.c (popup_activated): No longer const, since it's not const on at lest some configurations, and we shouldn't lie to the compiler.
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac5
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/make-docfile.c12
-rw-r--r--src/ChangeLog11
-rw-r--r--src/decompress.c3
-rw-r--r--src/gnutls.c3
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/xdisp.c3
-rw-r--r--src/xmenu.c2
10 files changed, 34 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index cca9100ddf7..309b04f26ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12015-01-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Give up on -Wsuggest-attribute=const
4 The attribute doesn't help performance significantly, and the
5 warning seems to be more trouble than it's worth. See the thread at:
6 http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00361.html
7 * configure.ac (WERROR_CFLAGS): Don't use -Wsuggest-attribute=const.
8
12015-01-11 Paul Eggert <eggert@cs.ucla.edu> 92015-01-11 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 Default to 'configure --enable-silent-rules' 11 Default to 'configure --enable-silent-rules'
diff --git a/configure.ac b/configure.ac
index 4cad214e928..9db4bdecfcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,6 +892,10 @@ else
892 # Emacs's use of alloca inhibits protecting the stack. 892 # Emacs's use of alloca inhibits protecting the stack.
893 nw="$nw -Wstack-protector" 893 nw="$nw -Wstack-protector"
894 894
895 # Emacs's use of partly-const functions such as Fgnutls_available_p
896 # make this option problematic.
897 nw="$nw -Wsuggest-attribute=const"
898
895 # Emacs's use of partly-pure functions such as CHECK_TYPE make this 899 # Emacs's use of partly-pure functions such as CHECK_TYPE make this
896 # option problematic. 900 # option problematic.
897 nw="$nw -Wsuggest-attribute=pure" 901 nw="$nw -Wsuggest-attribute=pure"
@@ -1974,7 +1978,6 @@ fi
1974if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then 1978if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
1975 # Too many warnings for now. 1979 # Too many warnings for now.
1976 nw= 1980 nw=
1977 nw="$nw -Wsuggest-attribute=const"
1978 nw="$nw -Wsuggest-attribute=noreturn" 1981 nw="$nw -Wsuggest-attribute=noreturn"
1979 gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) 1982 gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
1980 1983
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index e9205fdd12a..7cbf3274946 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
12015-01-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Give up on -Wsuggest-attribute=const
4 * make-docfile.c (write_globals):
5 Remove special hack for Fnext_read_file_uses_dialog_p
6
12015-01-13 Paul Eggert <eggert@cs.ucla.edu> 72015-01-13 Paul Eggert <eggert@cs.ucla.edu>
2 8
3 Don't say Fnext_read_file_uses_dialog_p is const 9 Don't say Fnext_read_file_uses_dialog_p is const
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 741fa4bfa42..79d421a0a8e 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -729,18 +729,6 @@ write_globals (void)
729 729
730 if (globals[i].flags & DEFUN_const) 730 if (globals[i].flags & DEFUN_const)
731 fputs (" ATTRIBUTE_CONST", stdout); 731 fputs (" ATTRIBUTE_CONST", stdout);
732 else if (strcmp (globals[i].name, "Fnext_read_file_uses_dialog_p")
733 == 0)
734 {
735 /* It would be nice to have a cleaner way to deal with this
736 special hack. */
737 fputs (("\n"
738 "#if ! (defined USE_GTK || defined USE_MOTIF \\\n"
739 " || defined HAVE_NS || defined HAVE_NTGUI)\n"
740 "\tATTRIBUTE_CONST\n"
741 "#endif\n"),
742 stdout);
743 }
744 732
745 puts (";"); 733 puts (";");
746 } 734 }
diff --git a/src/ChangeLog b/src/ChangeLog
index 40d8b267d84..ae634f318f0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12015-01-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Give up on -Wsuggest-attribute=const
4 * decompress.c (Fzlib_available_p):
5 * gnutls.c (Fgnutls_available_p):
6 * gtkutil.h (xg_uses_old_file_dialog):
7 * xdisp.c (Ftool_bar_height):
8 * xmenu.c (popup_activated):
9 No longer const, since it's not const on at lest some
10 configurations, and we shouldn't lie to the compiler.
11
12015-01-15 Eli Zaretskii <eliz@gnu.org> 122015-01-15 Eli Zaretskii <eliz@gnu.org>
2 13
3 * fileio.c: Include binary-io.h. 14 * fileio.c: Include binary-io.h.
diff --git a/src/decompress.c b/src/decompress.c
index b78dacee207..b14f0a2cd79 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -88,8 +88,7 @@ unwind_decompress (void *ddata)
88} 88}
89 89
90DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0, 90DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,
91 doc: /* Return t if zlib decompression is available in this instance of Emacs. */ 91 doc: /* Return t if zlib decompression is available in this instance of Emacs. */)
92 attributes: const)
93 (void) 92 (void)
94{ 93{
95#ifdef WINDOWSNT 94#ifdef WINDOWSNT
diff --git a/src/gnutls.c b/src/gnutls.c
index 909542f4212..35f0eb48bc1 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1619,8 +1619,7 @@ This function may also return `gnutls-e-again', or
1619#endif /* HAVE_GNUTLS */ 1619#endif /* HAVE_GNUTLS */
1620 1620
1621DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, 1621DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
1622 doc: /* Return t if GnuTLS is available in this instance of Emacs. */ 1622 doc: /* Return t if GnuTLS is available in this instance of Emacs. */)
1623 attributes: const)
1624 (void) 1623 (void)
1625{ 1624{
1626#ifdef HAVE_GNUTLS 1625#ifdef HAVE_GNUTLS
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 7d712c92e0d..0ac49ca7db5 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -78,7 +78,7 @@ typedef struct xg_menu_item_cb_data_
78 78
79} xg_menu_item_cb_data; 79} xg_menu_item_cb_data;
80 80
81extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST; 81extern bool xg_uses_old_file_dialog (void);
82 82
83extern char *xg_get_file_name (struct frame *f, 83extern char *xg_get_file_name (struct frame *f,
84 char *prompt, 84 char *prompt,
diff --git a/src/xdisp.c b/src/xdisp.c
index 041a022a370..f006f8e0b94 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12276,8 +12276,7 @@ DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height,
12276 0, 2, 0, 12276 0, 2, 0,
12277 doc: /* Return the number of lines occupied by the tool bar of FRAME. 12277 doc: /* Return the number of lines occupied by the tool bar of FRAME.
12278If FRAME is nil or omitted, use the selected frame. Optional argument 12278If FRAME is nil or omitted, use the selected frame. Optional argument
12279PIXELWISE non-nil means return the height of the tool bar in pixels. */ 12279PIXELWISE non-nil means return the height of the tool bar in pixels. */)
12280 attributes: const)
12281 (Lisp_Object frame, Lisp_Object pixelwise) 12280 (Lisp_Object frame, Lisp_Object pixelwise)
12282{ 12281{
12283 int height = 0; 12282 int height = 0;
diff --git a/src/xmenu.c b/src/xmenu.c
index 9063a8a2a52..fdf1f6f4d84 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2288,7 +2288,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
2288/* Detect if a dialog or menu has been posted. MSDOS has its own 2288/* Detect if a dialog or menu has been posted. MSDOS has its own
2289 implementation on msdos.c. */ 2289 implementation on msdos.c. */
2290 2290
2291int ATTRIBUTE_CONST 2291int
2292popup_activated (void) 2292popup_activated (void)
2293{ 2293{
2294 return popup_activated_flag; 2294 return popup_activated_flag;