Commit d6312354 authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent 715f0835
...@@ -1528,7 +1528,7 @@ process_file_name (char *file, language *lang) ...@@ -1528,7 +1528,7 @@ process_file_name (char *file, language *lang)
fdesc *fdp; fdesc *fdp;
compressor *compr; compressor *compr;
char *compressed_name, *uncompressed_name; char *compressed_name, *uncompressed_name;
char *ext, *real_name = NULL, *tmp_name; char *ext, *real_name UNINIT, *tmp_name;
int retval; int retval;
canonicalize_filename (file); canonicalize_filename (file);
...@@ -5594,7 +5594,7 @@ TeX_commands (FILE *inf) ...@@ -5594,7 +5594,7 @@ TeX_commands (FILE *inf)
linebuffer *key; linebuffer *key;
char TEX_esc = '\0'; char TEX_esc = '\0';
char TEX_opgrp = 0, TEX_clgrp = 0; char TEX_opgrp UNINIT, TEX_clgrp UNINIT;
/* Initialize token table once from environment. */ /* Initialize token table once from environment. */
if (TEX_toktab == NULL) if (TEX_toktab == NULL)
......
...@@ -3764,7 +3764,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) ...@@ -3764,7 +3764,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos)
/* If parent is nil, replace overlays_before; otherwise, parent->next. */ /* If parent is nil, replace overlays_before; otherwise, parent->next. */
struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
Lisp_Object tem; Lisp_Object tem;
ptrdiff_t end = prev; ptrdiff_t end UNINIT;
/* After the insertion, the several overlays may be in incorrect /* After the insertion, the several overlays may be in incorrect
order. The possibility is that, in the list `overlays_before', order. The possibility is that, in the list `overlays_before',
......
...@@ -1823,7 +1823,7 @@ The function `default-value' gets the default value and `set-default' sets it. ...@@ -1823,7 +1823,7 @@ The function `default-value' gets the default value and `set-default' sets it.
struct Lisp_Symbol *sym; struct Lisp_Symbol *sym;
struct Lisp_Buffer_Local_Value *blv = NULL; struct Lisp_Buffer_Local_Value *blv = NULL;
union Lisp_Val_Fwd valcontents; union Lisp_Val_Fwd valcontents;
bool forwarded = false; bool forwarded UNINIT;
CHECK_SYMBOL (variable); CHECK_SYMBOL (variable);
sym = XSYMBOL (variable); sym = XSYMBOL (variable);
...@@ -2607,7 +2607,7 @@ uintmax_t ...@@ -2607,7 +2607,7 @@ uintmax_t
cons_to_unsigned (Lisp_Object c, uintmax_t max) cons_to_unsigned (Lisp_Object c, uintmax_t max)
{ {
bool valid = false; bool valid = false;
uintmax_t val = max; uintmax_t val UNINIT;
if (INTEGERP (c)) if (INTEGERP (c))
{ {
valid = XINT (c) >= 0; valid = XINT (c) >= 0;
...@@ -2661,7 +2661,7 @@ intmax_t ...@@ -2661,7 +2661,7 @@ intmax_t
cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max)
{ {
bool valid = false; bool valid = false;
intmax_t val = max; intmax_t val UNINIT;
if (INTEGERP (c)) if (INTEGERP (c))
{ {
val = XINT (c); val = XINT (c);
......
...@@ -3612,8 +3612,9 @@ It returns the number of characters changed. */) ...@@ -3612,8 +3612,9 @@ It returns the number of characters changed. */)
cnt = 0; cnt = 0;
for (; pos < end_pos; ) for (; pos < end_pos; )
{ {
register unsigned char *p = BYTE_POS_ADDR (pos_byte); unsigned char *p = BYTE_POS_ADDR (pos_byte);
unsigned char *str = tt, buf[MAX_MULTIBYTE_LENGTH]; unsigned char *str UNINIT;
unsigned char buf[MAX_MULTIBYTE_LENGTH];
int len, str_len; int len, str_len;
int oc; int oc;
Lisp_Object val; Lisp_Object val;
......
...@@ -30,6 +30,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -30,6 +30,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "dispextern.h" #include "dispextern.h"
#include "buffer.h" #include "buffer.h"
/* CACHEABLE is ordinarily nothing, except it is 'volatile' if
necessary to cajole GCC into not warning incorrectly that a
variable should be volatile. */
#if defined GCC_LINT || defined lint
# define CACHEABLE volatile
#else
# define CACHEABLE /* empty */
#endif
/* Chain of condition and catch handlers currently in effect. */ /* Chain of condition and catch handlers currently in effect. */
/* struct handler *handlerlist; */ /* struct handler *handlerlist; */
...@@ -1226,7 +1235,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, ...@@ -1226,7 +1235,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform,
Lisp_Object handlers) Lisp_Object handlers)
{ {
struct handler *oldhandlerlist = handlerlist; struct handler *oldhandlerlist = handlerlist;
volatile ptrdiff_t clausenb = 0; ptrdiff_t CACHEABLE clausenb = 0;
CHECK_SYMBOL (var); CHECK_SYMBOL (var);
......
...@@ -125,6 +125,7 @@ tparam1 (const char *string, char *outstring, int len, ...@@ -125,6 +125,7 @@ tparam1 (const char *string, char *outstring, int len,
goto onedigit; goto onedigit;
if (tem < 100) if (tem < 100)
goto twodigit; goto twodigit;
FALLTHROUGH;
case '3': /* %3 means output in decimal, 3 digits. */ case '3': /* %3 means output in decimal, 3 digits. */
if (tem > 999) if (tem > 999)
{ {
...@@ -132,6 +133,7 @@ tparam1 (const char *string, char *outstring, int len, ...@@ -132,6 +133,7 @@ tparam1 (const char *string, char *outstring, int len,
tem %= 1000; tem %= 1000;
} }
*op++ = tem / 100 + '0'; *op++ = tem / 100 + '0';
FALLTHROUGH;
case '2': /* %2 means output in decimal, 2 digits. */ case '2': /* %2 means output in decimal, 2 digits. */
twodigit: twodigit:
tem %= 100; tem %= 100;
...@@ -140,10 +142,12 @@ tparam1 (const char *string, char *outstring, int len, ...@@ -140,10 +142,12 @@ tparam1 (const char *string, char *outstring, int len,
*op++ = tem % 10 + '0'; *op++ = tem % 10 + '0';
argp++; argp++;
break; break;
case 'p': /* %pN means use param N for next subst. */ case 'p': /* %pN means use param N for next subst. */
tem = fixed_argp[(*p++) - '1']; tem = fixed_argp[(*p++) - '1'];
explicit_param_p = true; explicit_param_p = true;
break; break;
case 'C': case 'C':
/* For c-100: print quotient of value by 96, if nonzero, /* For c-100: print quotient of value by 96, if nonzero,
then do like %+. */ then do like %+. */
...@@ -152,8 +156,10 @@ tparam1 (const char *string, char *outstring, int len, ...@@ -152,8 +156,10 @@ tparam1 (const char *string, char *outstring, int len,
*op++ = tem / 96; *op++ = tem / 96;
tem %= 96; tem %= 96;
} }
FALLTHROUGH;
case '+': /* %+x means add character code of char x. */ case '+': /* %+x means add character code of char x. */
tem += *p++; tem += *p++;
FALLTHROUGH;
case '.': /* %. means output as character. */ case '.': /* %. means output as character. */
if (left) if (left)
{ {
...@@ -173,6 +179,7 @@ tparam1 (const char *string, char *outstring, int len, ...@@ -173,6 +179,7 @@ tparam1 (const char *string, char *outstring, int len,
} }
} }
*op++ = tem ? tem : 0200; *op++ = tem ? tem : 0200;
FALLTHROUGH;
case 'f': /* %f means discard next arg. */ case 'f': /* %f means discard next arg. */
argp++; argp++;
break; break;
......
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