diff options
| author | Paul Eggert | 2017-09-09 11:10:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-09 11:11:51 -0700 |
| commit | d63123542ffd60dbec0c9038144329b99f0f1d65 (patch) | |
| tree | 8338da31228034a2e5db48e8e0840d0d126e51ed /src | |
| parent | 715f0835b5a0c17f2fcb43d1e75d55adce1639a5 (diff) | |
| download | emacs-d63123542ffd60dbec0c9038144329b99f0f1d65.tar.gz emacs-d63123542ffd60dbec0c9038144329b99f0f1d65.zip | |
Improve --enable-gcc-warnings for MinGW64
This partially reverts my 2016-05-30 patch. Apparently MinGW64
still requires pacifications that GCC 7.1.1 x86-64 (Fedora 26)
does not. Also, pacify tparam.c, which isn’t used on Fedora.
* lib-src/etags.c (process_file_name, TeX_commands):
* src/buffer.c (fix_overlays_before):
* src/data.c (Fmake_variable_buffer_local, cons_to_unsigned)
(cons_to_signed):
* src/editfns.c (Ftranslate_region_internal):
Prefer UNINIT to some stray value, as this simplifies
code-reading later.
* src/eval.c (CACHEABLE): New macro.
(internal_lisp_condition_case): Use it.
* src/tparam.c (tparam1): Use FALLTHROUGH to pacify GCC.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/data.c | 6 | ||||
| -rw-r--r-- | src/editfns.c | 5 | ||||
| -rw-r--r-- | src/eval.c | 11 | ||||
| -rw-r--r-- | src/tparam.c | 7 |
5 files changed, 24 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index 0827e9ba445..f2689b61fdb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -3764,7 +3764,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) | |||
| 3764 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ | 3764 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ |
| 3765 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; | 3765 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; |
| 3766 | Lisp_Object tem; | 3766 | Lisp_Object tem; |
| 3767 | ptrdiff_t end = prev; | 3767 | ptrdiff_t end UNINIT; |
| 3768 | 3768 | ||
| 3769 | /* After the insertion, the several overlays may be in incorrect | 3769 | /* After the insertion, the several overlays may be in incorrect |
| 3770 | order. The possibility is that, in the list `overlays_before', | 3770 | order. The possibility is that, in the list `overlays_before', |
diff --git a/src/data.c b/src/data.c index 87010e3fb28..c9818b6b20f 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1823,7 +1823,7 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1823 | struct Lisp_Symbol *sym; | 1823 | struct Lisp_Symbol *sym; |
| 1824 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1824 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| 1825 | union Lisp_Val_Fwd valcontents; | 1825 | union Lisp_Val_Fwd valcontents; |
| 1826 | bool forwarded = false; | 1826 | bool forwarded UNINIT; |
| 1827 | 1827 | ||
| 1828 | CHECK_SYMBOL (variable); | 1828 | CHECK_SYMBOL (variable); |
| 1829 | sym = XSYMBOL (variable); | 1829 | sym = XSYMBOL (variable); |
| @@ -2607,7 +2607,7 @@ uintmax_t | |||
| 2607 | cons_to_unsigned (Lisp_Object c, uintmax_t max) | 2607 | cons_to_unsigned (Lisp_Object c, uintmax_t max) |
| 2608 | { | 2608 | { |
| 2609 | bool valid = false; | 2609 | bool valid = false; |
| 2610 | uintmax_t val = max; | 2610 | uintmax_t val UNINIT; |
| 2611 | if (INTEGERP (c)) | 2611 | if (INTEGERP (c)) |
| 2612 | { | 2612 | { |
| 2613 | valid = XINT (c) >= 0; | 2613 | valid = XINT (c) >= 0; |
| @@ -2661,7 +2661,7 @@ intmax_t | |||
| 2661 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) | 2661 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) |
| 2662 | { | 2662 | { |
| 2663 | bool valid = false; | 2663 | bool valid = false; |
| 2664 | intmax_t val = max; | 2664 | intmax_t val UNINIT; |
| 2665 | if (INTEGERP (c)) | 2665 | if (INTEGERP (c)) |
| 2666 | { | 2666 | { |
| 2667 | val = XINT (c); | 2667 | val = XINT (c); |
diff --git a/src/editfns.c b/src/editfns.c index 95f35549e4e..d54c9c1abaf 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3612,8 +3612,9 @@ It returns the number of characters changed. */) | |||
| 3612 | cnt = 0; | 3612 | cnt = 0; |
| 3613 | for (; pos < end_pos; ) | 3613 | for (; pos < end_pos; ) |
| 3614 | { | 3614 | { |
| 3615 | register unsigned char *p = BYTE_POS_ADDR (pos_byte); | 3615 | unsigned char *p = BYTE_POS_ADDR (pos_byte); |
| 3616 | unsigned char *str = tt, buf[MAX_MULTIBYTE_LENGTH]; | 3616 | unsigned char *str UNINIT; |
| 3617 | unsigned char buf[MAX_MULTIBYTE_LENGTH]; | ||
| 3617 | int len, str_len; | 3618 | int len, str_len; |
| 3618 | int oc; | 3619 | int oc; |
| 3619 | Lisp_Object val; | 3620 | Lisp_Object val; |
diff --git a/src/eval.c b/src/eval.c index c2cd6c60ea4..a6612b93e25 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -30,6 +30,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 30 | #include "dispextern.h" | 30 | #include "dispextern.h" |
| 31 | #include "buffer.h" | 31 | #include "buffer.h" |
| 32 | 32 | ||
| 33 | /* CACHEABLE is ordinarily nothing, except it is 'volatile' if | ||
| 34 | necessary to cajole GCC into not warning incorrectly that a | ||
| 35 | variable should be volatile. */ | ||
| 36 | #if defined GCC_LINT || defined lint | ||
| 37 | # define CACHEABLE volatile | ||
| 38 | #else | ||
| 39 | # define CACHEABLE /* empty */ | ||
| 40 | #endif | ||
| 41 | |||
| 33 | /* Chain of condition and catch handlers currently in effect. */ | 42 | /* Chain of condition and catch handlers currently in effect. */ |
| 34 | 43 | ||
| 35 | /* struct handler *handlerlist; */ | 44 | /* struct handler *handlerlist; */ |
| @@ -1226,7 +1235,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, | |||
| 1226 | Lisp_Object handlers) | 1235 | Lisp_Object handlers) |
| 1227 | { | 1236 | { |
| 1228 | struct handler *oldhandlerlist = handlerlist; | 1237 | struct handler *oldhandlerlist = handlerlist; |
| 1229 | volatile ptrdiff_t clausenb = 0; | 1238 | ptrdiff_t CACHEABLE clausenb = 0; |
| 1230 | 1239 | ||
| 1231 | CHECK_SYMBOL (var); | 1240 | CHECK_SYMBOL (var); |
| 1232 | 1241 | ||
diff --git a/src/tparam.c b/src/tparam.c index 7a4adc2dc94..92fa5b19df7 100644 --- a/src/tparam.c +++ b/src/tparam.c | |||
| @@ -125,6 +125,7 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 125 | goto onedigit; | 125 | goto onedigit; |
| 126 | if (tem < 100) | 126 | if (tem < 100) |
| 127 | goto twodigit; | 127 | goto twodigit; |
| 128 | FALLTHROUGH; | ||
| 128 | case '3': /* %3 means output in decimal, 3 digits. */ | 129 | case '3': /* %3 means output in decimal, 3 digits. */ |
| 129 | if (tem > 999) | 130 | if (tem > 999) |
| 130 | { | 131 | { |
| @@ -132,6 +133,7 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 132 | tem %= 1000; | 133 | tem %= 1000; |
| 133 | } | 134 | } |
| 134 | *op++ = tem / 100 + '0'; | 135 | *op++ = tem / 100 + '0'; |
| 136 | FALLTHROUGH; | ||
| 135 | case '2': /* %2 means output in decimal, 2 digits. */ | 137 | case '2': /* %2 means output in decimal, 2 digits. */ |
| 136 | twodigit: | 138 | twodigit: |
| 137 | tem %= 100; | 139 | tem %= 100; |
| @@ -140,10 +142,12 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 140 | *op++ = tem % 10 + '0'; | 142 | *op++ = tem % 10 + '0'; |
| 141 | argp++; | 143 | argp++; |
| 142 | break; | 144 | break; |
| 145 | |||
| 143 | case 'p': /* %pN means use param N for next subst. */ | 146 | case 'p': /* %pN means use param N for next subst. */ |
| 144 | tem = fixed_argp[(*p++) - '1']; | 147 | tem = fixed_argp[(*p++) - '1']; |
| 145 | explicit_param_p = true; | 148 | explicit_param_p = true; |
| 146 | break; | 149 | break; |
| 150 | |||
| 147 | case 'C': | 151 | case 'C': |
| 148 | /* For c-100: print quotient of value by 96, if nonzero, | 152 | /* For c-100: print quotient of value by 96, if nonzero, |
| 149 | then do like %+. */ | 153 | then do like %+. */ |
| @@ -152,8 +156,10 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 152 | *op++ = tem / 96; | 156 | *op++ = tem / 96; |
| 153 | tem %= 96; | 157 | tem %= 96; |
| 154 | } | 158 | } |
| 159 | FALLTHROUGH; | ||
| 155 | case '+': /* %+x means add character code of char x. */ | 160 | case '+': /* %+x means add character code of char x. */ |
| 156 | tem += *p++; | 161 | tem += *p++; |
| 162 | FALLTHROUGH; | ||
| 157 | case '.': /* %. means output as character. */ | 163 | case '.': /* %. means output as character. */ |
| 158 | if (left) | 164 | if (left) |
| 159 | { | 165 | { |
| @@ -173,6 +179,7 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 173 | } | 179 | } |
| 174 | } | 180 | } |
| 175 | *op++ = tem ? tem : 0200; | 181 | *op++ = tem ? tem : 0200; |
| 182 | FALLTHROUGH; | ||
| 176 | case 'f': /* %f means discard next arg. */ | 183 | case 'f': /* %f means discard next arg. */ |
| 177 | argp++; | 184 | argp++; |
| 178 | break; | 185 | break; |