]> code.delx.au - gnu-emacs/commitdiff
Work around GCC bug 54561 in a better way
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Jul 2016 08:31:33 +0000 (10:31 +0200)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Jul 2016 08:32:24 +0000 (10:32 +0200)
The new approach is less selective, but also less intrusive on C code.
* src/bytecode.c, src/image.c, src/keyboard.c: Ignore -Wclobbered.
* src/conf_post.h (NONVOLATILE): Remove.  All uses removed.

src/bytecode.c
src/conf_post.h
src/image.c
src/keyboard.c

index bb7922d54a49f3f3eb98aa0e0b21ecd0b6e30542..1b02c60c618d075c373e7b08f9716ef74d162bd8 100644 (file)
@@ -32,6 +32,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "xterm.h"
 #endif
 
+/* Work around GCC bug 54561.  */
+#if GNUC_PREREQ (4, 3, 0)
+# pragma GCC diagnostic ignored "-Wclobbered"
+#endif
+
 /*
  * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for
  * debugging the byte compiler...)
index 99aafbffae671e1cbca0ef0f7fa17ed97155aaed..865d0183a57380b05d13f880208d236322f059d5 100644 (file)
@@ -368,15 +368,6 @@ extern int emacs_setenv_TZ (char const *);
 # define FLEXIBLE_ARRAY_MEMBER
 #endif
 
-/* When used in place of 'volatile', 'NONVOLATILE' is equivalent to nothing,
-   except it cajoles GCC into not warning incorrectly that a variable needs to
-   be volatile.  This works around GCC bug 54561.  */
-#if defined GCC_LINT || defined lint
-# define NONVOLATILE volatile
-#else
-# define NONVOLATILE /* empty */
-#endif
-
 /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC
    into not warning incorrectly about use of an uninitialized variable.  */
 #if defined GCC_LINT || defined lint
index 572557dd26422d9f4cba64731a6dee8967514504..1770de7e8ff1394e35f16149cd1c896dbb96666d 100644 (file)
@@ -56,6 +56,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include TERM_HEADER
 #endif /* HAVE_WINDOW_SYSTEM */
 
+/* Work around GCC bug 54561.  */
+#if GNUC_PREREQ (4, 3, 0)
+# pragma GCC diagnostic ignored "-Wclobbered"
+#endif
+
 #ifdef HAVE_X_WINDOWS
 typedef struct x_bitmap_record Bitmap_Record;
 #define GET_PIXEL(ximg, x, y) XGetPixel (ximg, x, y)
@@ -5897,9 +5902,8 @@ struct png_load_context
 static bool
 png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
 {
-  Lisp_Object specified_file;
-  Lisp_Object NONVOLATILE specified_data;
-  FILE *NONVOLATILE fp = NULL;
+  Lisp_Object specified_file, specified_data;
+  FILE *fp = NULL;
   int x, y;
   ptrdiff_t i;
   png_struct *png_ptr;
@@ -6669,8 +6673,7 @@ static bool
 jpeg_load_body (struct frame *f, struct image *img,
                struct my_jpeg_error_mgr *mgr)
 {
-  Lisp_Object specified_file;
-  Lisp_Object NONVOLATILE specified_data;
+  Lisp_Object specified_file, specified_data;
   FILE *volatile fp = NULL;
   JSAMPARRAY buffer;
   int row_stride, x, y;
index 653f52732a70dacc634049bf44f566764c8c418f..8901ff055e7e69fd8e2beb9018ba89683daf70b2 100644 (file)
@@ -70,6 +70,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include TERM_HEADER
 #endif /* HAVE_WINDOW_SYSTEM */
 
+/* Work around GCC bug 54561.  */
+#if GNUC_PREREQ (4, 3, 0)
+# pragma GCC diagnostic ignored "-Wclobbered"
+#endif
+
 /* Variables for blockinput.h:  */
 
 /* Positive if interrupt input is blocked right now.  */
@@ -2320,7 +2325,7 @@ read_char (int commandflag, Lisp_Object map,
           Lisp_Object prev_event,
           bool *used_mouse_menu, struct timespec *end_time)
 {
-  Lisp_Object NONVOLATILE c;
+  Lisp_Object c;
   ptrdiff_t jmpcount;
   sys_jmp_buf local_getcjmp;
   sys_jmp_buf save_jump;