Commit 0adc75af authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent 255d2a5a
2015-01-16 Paul Eggert <eggert@cs.ucla.edu>
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.
2015-01-11 Paul Eggert <eggert@cs.ucla.edu> 2015-01-11 Paul Eggert <eggert@cs.ucla.edu>
Default to 'configure --enable-silent-rules' Default to 'configure --enable-silent-rules'
......
...@@ -892,6 +892,10 @@ else ...@@ -892,6 +892,10 @@ else
# Emacs's use of alloca inhibits protecting the stack. # Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector" nw="$nw -Wstack-protector"
# Emacs's use of partly-const functions such as Fgnutls_available_p
# make this option problematic.
nw="$nw -Wsuggest-attribute=const"
# Emacs's use of partly-pure functions such as CHECK_TYPE make this # Emacs's use of partly-pure functions such as CHECK_TYPE make this
# option problematic. # option problematic.
nw="$nw -Wsuggest-attribute=pure" nw="$nw -Wsuggest-attribute=pure"
...@@ -1974,7 +1978,6 @@ fi ...@@ -1974,7 +1978,6 @@ fi
if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
# Too many warnings for now. # Too many warnings for now.
nw= nw=
nw="$nw -Wsuggest-attribute=const"
nw="$nw -Wsuggest-attribute=noreturn" nw="$nw -Wsuggest-attribute=noreturn"
gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
......
2015-01-16 Paul Eggert <eggert@cs.ucla.edu>
Give up on -Wsuggest-attribute=const
* make-docfile.c (write_globals):
Remove special hack for Fnext_read_file_uses_dialog_p
2015-01-13 Paul Eggert <eggert@cs.ucla.edu> 2015-01-13 Paul Eggert <eggert@cs.ucla.edu>
Don't say Fnext_read_file_uses_dialog_p is const Don't say Fnext_read_file_uses_dialog_p is const
......
...@@ -729,18 +729,6 @@ write_globals (void) ...@@ -729,18 +729,6 @@ write_globals (void)
if (globals[i].flags & DEFUN_const) if (globals[i].flags & DEFUN_const)
fputs (" ATTRIBUTE_CONST", stdout); 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 (";"); puts (";");
} }
......
2015-01-16 Paul Eggert <eggert@cs.ucla.edu>
Give up on -Wsuggest-attribute=const
* decompress.c (Fzlib_available_p):
* gnutls.c (Fgnutls_available_p):
* gtkutil.h (xg_uses_old_file_dialog):
* xdisp.c (Ftool_bar_height):
* 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.
2015-01-15 Eli Zaretskii <eliz@gnu.org> 2015-01-15 Eli Zaretskii <eliz@gnu.org>
   
* fileio.c: Include binary-io.h. * fileio.c: Include binary-io.h.
......
...@@ -88,8 +88,7 @@ unwind_decompress (void *ddata) ...@@ -88,8 +88,7 @@ unwind_decompress (void *ddata)
} }
DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0, DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,
doc: /* Return t if zlib decompression is available in this instance of Emacs. */ doc: /* Return t if zlib decompression is available in this instance of Emacs. */)
attributes: const)
(void) (void)
{ {
#ifdef WINDOWSNT #ifdef WINDOWSNT
......
...@@ -1619,8 +1619,7 @@ This function may also return `gnutls-e-again', or ...@@ -1619,8 +1619,7 @@ This function may also return `gnutls-e-again', or
#endif /* HAVE_GNUTLS */ #endif /* HAVE_GNUTLS */
DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
doc: /* Return t if GnuTLS is available in this instance of Emacs. */ doc: /* Return t if GnuTLS is available in this instance of Emacs. */)
attributes: const)
(void) (void)
{ {
#ifdef HAVE_GNUTLS #ifdef HAVE_GNUTLS
......
...@@ -78,7 +78,7 @@ typedef struct xg_menu_item_cb_data_ ...@@ -78,7 +78,7 @@ typedef struct xg_menu_item_cb_data_
} xg_menu_item_cb_data; } xg_menu_item_cb_data;
extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST; extern bool xg_uses_old_file_dialog (void);
extern char *xg_get_file_name (struct frame *f, extern char *xg_get_file_name (struct frame *f,
char *prompt, char *prompt,
......
...@@ -12276,8 +12276,7 @@ DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height, ...@@ -12276,8 +12276,7 @@ DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height,
0, 2, 0, 0, 2, 0,
doc: /* Return the number of lines occupied by the tool bar of FRAME. doc: /* Return the number of lines occupied by the tool bar of FRAME.
If FRAME is nil or omitted, use the selected frame. Optional argument If FRAME is nil or omitted, use the selected frame. Optional argument
PIXELWISE non-nil means return the height of the tool bar in pixels. */ PIXELWISE non-nil means return the height of the tool bar in pixels. */)
attributes: const)
(Lisp_Object frame, Lisp_Object pixelwise) (Lisp_Object frame, Lisp_Object pixelwise)
{ {
int height = 0; int height = 0;
......
...@@ -2288,7 +2288,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags, ...@@ -2288,7 +2288,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
/* Detect if a dialog or menu has been posted. MSDOS has its own /* Detect if a dialog or menu has been posted. MSDOS has its own
implementation on msdos.c. */ implementation on msdos.c. */
int ATTRIBUTE_CONST int
popup_activated (void) popup_activated (void)
{ {
return popup_activated_flag; return popup_activated_flag;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment