Commit be90cd14 authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid compiler warnings on MS-Windows with GCC 6 and 7

* src/w32font.c (SUBRANGE): Use unsigned arithmetic for
bit-shifting, to avoid compiler warnings.
(w32font_text_extents): Tell GCC NGLYPHS is non-negative, to avoid
a warning.  For details of the warning, see
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html.
* src/term.c (keys) [WINDOWSNT]: Don't define, as it is not used
in that build.
* src/sound.c (sound_perror): Ifdef away on WINDOWSNT, as this
function is not used in that build.

* configure.ac: Disable -Wsuggest-attribute=format on MS-Windows.
parent e2a10d7f
......@@ -976,9 +976,10 @@ AS_IF([test $gl_gcc_warnings = no],
nw="$nw -Wmissing-braces"
fi
# This causes too much noise in the MinGW build
# These cause too much noise in the MinGW build
if test $opsys = mingw32; then
nw="$nw -Wpointer-sign"
nw="$nw -Wsuggest-attribute=format"
fi
gl_MANYWARN_ALL_GCC([ws])
......
......@@ -293,6 +293,7 @@ static int do_play_sound (const char *, unsigned long);
/* BEGIN: Common functions */
#ifndef WINDOWSNT
/* Like perror, but signals an error. */
static _Noreturn void
......@@ -315,8 +316,6 @@ sound_perror (const char *msg)
error ("%s", msg);
}
#ifndef WINDOWSNT
/* Display a warning message. */
static void
......
......@@ -1210,6 +1210,7 @@ struct fkey_table {
const char *cap, *name;
};
#ifndef DOS_NT
/* Termcap capability names that correspond directly to X keysyms.
Some of these (marked "terminfo") aren't supplied by old-style
(Berkeley) termcap entries. They're listed in X keysym order;
......@@ -1313,7 +1314,6 @@ static const struct fkey_table keys[] =
{"!3", "S-undo"} /*shifted undo key*/
};
#ifndef DOS_NT
static char **term_get_fkeys_address;
static KBOARD *term_get_fkeys_kboard;
static Lisp_Object term_get_fkeys_1 (void);
......
......@@ -544,6 +544,7 @@ w32font_text_extents (struct font *font, unsigned *code,
information. */
/* Make array big enough to hold surrogates. */
eassume (0 <= nglyphs); /* pacify GCC warning on next line */
wcode = alloca (nglyphs * sizeof (WORD) * 2);
for (i = 0; i < nglyphs; i++)
{
......@@ -2188,7 +2189,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
/* Match a single subrange. SYM is set if bit N is set in subranges. */
#define SUBRANGE(n,sym) \
if (subranges[(n) / 32] & (1 << ((n) % 32))) \
if (subranges[(n) / 32] & (1U << ((n) % 32))) \
supported = Fcons ((sym), supported)
/* Match multiple subranges. SYM is set if any MASK bit is set in
......
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