diff options
| author | Paul Eggert | 2016-07-20 10:31:33 +0200 |
|---|---|---|
| committer | Paul Eggert | 2016-07-20 10:32:24 +0200 |
| commit | 3e71e4379ce7b53afe51ead4c94e6bb016bc6e7a (patch) | |
| tree | f1a28805fc683c4b9cf712c73283ec4115fcdd75 /src | |
| parent | 63750fd4ed4ff8bb9b3ff8868d4e36e3422adb21 (diff) | |
| download | emacs-3e71e4379ce7b53afe51ead4c94e6bb016bc6e7a.tar.gz emacs-3e71e4379ce7b53afe51ead4c94e6bb016bc6e7a.zip | |
Work around GCC bug 54561 in a better way
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bytecode.c | 5 | ||||
| -rw-r--r-- | src/conf_post.h | 9 | ||||
| -rw-r--r-- | src/image.c | 13 | ||||
| -rw-r--r-- | src/keyboard.c | 7 |
4 files changed, 19 insertions, 15 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index bb7922d54a4..1b02c60c618 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -32,6 +32,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 32 | #include "xterm.h" | 32 | #include "xterm.h" |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | /* Work around GCC bug 54561. */ | ||
| 36 | #if GNUC_PREREQ (4, 3, 0) | ||
| 37 | # pragma GCC diagnostic ignored "-Wclobbered" | ||
| 38 | #endif | ||
| 39 | |||
| 35 | /* | 40 | /* |
| 36 | * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for | 41 | * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for |
| 37 | * debugging the byte compiler...) | 42 | * debugging the byte compiler...) |
diff --git a/src/conf_post.h b/src/conf_post.h index 99aafbffae6..865d0183a57 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -368,15 +368,6 @@ extern int emacs_setenv_TZ (char const *); | |||
| 368 | # define FLEXIBLE_ARRAY_MEMBER | 368 | # define FLEXIBLE_ARRAY_MEMBER |
| 369 | #endif | 369 | #endif |
| 370 | 370 | ||
| 371 | /* When used in place of 'volatile', 'NONVOLATILE' is equivalent to nothing, | ||
| 372 | except it cajoles GCC into not warning incorrectly that a variable needs to | ||
| 373 | be volatile. This works around GCC bug 54561. */ | ||
| 374 | #if defined GCC_LINT || defined lint | ||
| 375 | # define NONVOLATILE volatile | ||
| 376 | #else | ||
| 377 | # define NONVOLATILE /* empty */ | ||
| 378 | #endif | ||
| 379 | |||
| 380 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC | 371 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC |
| 381 | into not warning incorrectly about use of an uninitialized variable. */ | 372 | into not warning incorrectly about use of an uninitialized variable. */ |
| 382 | #if defined GCC_LINT || defined lint | 373 | #if defined GCC_LINT || defined lint |
diff --git a/src/image.c b/src/image.c index 572557dd264..1770de7e8ff 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -56,6 +56,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 56 | #include TERM_HEADER | 56 | #include TERM_HEADER |
| 57 | #endif /* HAVE_WINDOW_SYSTEM */ | 57 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 58 | 58 | ||
| 59 | /* Work around GCC bug 54561. */ | ||
| 60 | #if GNUC_PREREQ (4, 3, 0) | ||
| 61 | # pragma GCC diagnostic ignored "-Wclobbered" | ||
| 62 | #endif | ||
| 63 | |||
| 59 | #ifdef HAVE_X_WINDOWS | 64 | #ifdef HAVE_X_WINDOWS |
| 60 | typedef struct x_bitmap_record Bitmap_Record; | 65 | typedef struct x_bitmap_record Bitmap_Record; |
| 61 | #define GET_PIXEL(ximg, x, y) XGetPixel (ximg, x, y) | 66 | #define GET_PIXEL(ximg, x, y) XGetPixel (ximg, x, y) |
| @@ -5897,9 +5902,8 @@ struct png_load_context | |||
| 5897 | static bool | 5902 | static bool |
| 5898 | png_load_body (struct frame *f, struct image *img, struct png_load_context *c) | 5903 | png_load_body (struct frame *f, struct image *img, struct png_load_context *c) |
| 5899 | { | 5904 | { |
| 5900 | Lisp_Object specified_file; | 5905 | Lisp_Object specified_file, specified_data; |
| 5901 | Lisp_Object NONVOLATILE specified_data; | 5906 | FILE *fp = NULL; |
| 5902 | FILE *NONVOLATILE fp = NULL; | ||
| 5903 | int x, y; | 5907 | int x, y; |
| 5904 | ptrdiff_t i; | 5908 | ptrdiff_t i; |
| 5905 | png_struct *png_ptr; | 5909 | png_struct *png_ptr; |
| @@ -6669,8 +6673,7 @@ static bool | |||
| 6669 | jpeg_load_body (struct frame *f, struct image *img, | 6673 | jpeg_load_body (struct frame *f, struct image *img, |
| 6670 | struct my_jpeg_error_mgr *mgr) | 6674 | struct my_jpeg_error_mgr *mgr) |
| 6671 | { | 6675 | { |
| 6672 | Lisp_Object specified_file; | 6676 | Lisp_Object specified_file, specified_data; |
| 6673 | Lisp_Object NONVOLATILE specified_data; | ||
| 6674 | FILE *volatile fp = NULL; | 6677 | FILE *volatile fp = NULL; |
| 6675 | JSAMPARRAY buffer; | 6678 | JSAMPARRAY buffer; |
| 6676 | int row_stride, x, y; | 6679 | int row_stride, x, y; |
diff --git a/src/keyboard.c b/src/keyboard.c index 653f52732a7..8901ff055e7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -70,6 +70,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 70 | #include TERM_HEADER | 70 | #include TERM_HEADER |
| 71 | #endif /* HAVE_WINDOW_SYSTEM */ | 71 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 72 | 72 | ||
| 73 | /* Work around GCC bug 54561. */ | ||
| 74 | #if GNUC_PREREQ (4, 3, 0) | ||
| 75 | # pragma GCC diagnostic ignored "-Wclobbered" | ||
| 76 | #endif | ||
| 77 | |||
| 73 | /* Variables for blockinput.h: */ | 78 | /* Variables for blockinput.h: */ |
| 74 | 79 | ||
| 75 | /* Positive if interrupt input is blocked right now. */ | 80 | /* Positive if interrupt input is blocked right now. */ |
| @@ -2320,7 +2325,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2320 | Lisp_Object prev_event, | 2325 | Lisp_Object prev_event, |
| 2321 | bool *used_mouse_menu, struct timespec *end_time) | 2326 | bool *used_mouse_menu, struct timespec *end_time) |
| 2322 | { | 2327 | { |
| 2323 | Lisp_Object NONVOLATILE c; | 2328 | Lisp_Object c; |
| 2324 | ptrdiff_t jmpcount; | 2329 | ptrdiff_t jmpcount; |
| 2325 | sys_jmp_buf local_getcjmp; | 2330 | sys_jmp_buf local_getcjmp; |
| 2326 | sys_jmp_buf save_jump; | 2331 | sys_jmp_buf save_jump; |