deal with some MSYS2 warnings
This commit is contained in:
@@ -665,6 +665,7 @@ execplinehandler(const char *line)
|
|||||||
args[1] = line;
|
args[1] = line;
|
||||||
args[2] = NULL;
|
args[2] = NULL;
|
||||||
ret = _spawnv(_P_NOWAIT, sysopt.msghandler, args);
|
ret = _spawnv(_P_NOWAIT, sysopt.msghandler, args);
|
||||||
|
nhUse(ret); /* -Wunused-but-set-variable */
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
use_pline_handler = FALSE;
|
use_pline_handler = FALSE;
|
||||||
|
|||||||
@@ -339,13 +339,14 @@ ifeq "$(GCC_EXTRA_WARNINGS)" "Y"
|
|||||||
#
|
#
|
||||||
# These match the warnings enabled on the linux.370 and macOS.370 hints builds
|
# These match the warnings enabled on the linux.370 and macOS.370 hints builds
|
||||||
#
|
#
|
||||||
CFLAGSXTRA = -Wall -Wextra -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow \
|
CFLAGSXTRA = -Wall -Wextra -Wreturn-type -Wunused -Wswitch -Wshadow \
|
||||||
-Wwrite-strings -pedantic -Wmissing-declarations \
|
-Wwrite-strings -pedantic -Wmissing-declarations \
|
||||||
-Wformat-nonliteral -Wunreachable-code -Wimplicit \
|
-Wformat-nonliteral -Wunreachable-code -Wimplicit \
|
||||||
-Wimplicit-function-declaration -Wimplicit-int \
|
-Wimplicit-function-declaration -Wimplicit-int \
|
||||||
-Wmissing-prototypes -Wold-style-definition \
|
-Wmissing-prototypes -Wold-style-definition \
|
||||||
-Wstrict-prototypes -Wnonnull -Wformat-overflow \
|
-Wstrict-prototypes -Wnonnull -Wformat-overflow \
|
||||||
-Wmissing-parameter-type -Wimplicit-fallthrough
|
-Wmissing-parameter-type -Wimplicit-fallthrough \
|
||||||
|
-Wno-cast-function-type
|
||||||
|
|
||||||
CPPFLAGSXTRA = -Wall -Wextra -Wno-missing-field-initializers -Wreturn-type \
|
CPPFLAGSXTRA = -Wall -Wextra -Wno-missing-field-initializers -Wreturn-type \
|
||||||
-Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -pedantic \
|
-Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -pedantic \
|
||||||
|
|||||||
+21
-9
@@ -53,10 +53,11 @@ int redirect_stdout;
|
|||||||
|
|
||||||
#ifdef WIN32CON
|
#ifdef WIN32CON
|
||||||
typedef HWND(WINAPI *GETCONSOLEWINDOW)(void);
|
typedef HWND(WINAPI *GETCONSOLEWINDOW)(void);
|
||||||
#ifdef WIN32CON
|
#if 0
|
||||||
static HWND GetConsoleHandle(void);
|
static HWND GetConsoleHandle(void);
|
||||||
static HWND GetConsoleHwnd(void);
|
static HWND GetConsoleHwnd(void);
|
||||||
#endif
|
#endif /* 0 */
|
||||||
|
#endif /* WIN32CON */
|
||||||
#if !defined(TTY_GRAPHICS)
|
#if !defined(TTY_GRAPHICS)
|
||||||
extern void backsp(void);
|
extern void backsp(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -78,7 +79,6 @@ static int max_filename(void);
|
|||||||
|
|
||||||
int def_kbhit(void);
|
int def_kbhit(void);
|
||||||
int (*nt_kbhit)(void) = def_kbhit;
|
int (*nt_kbhit)(void) = def_kbhit;
|
||||||
#endif /* WIN32CON */
|
|
||||||
|
|
||||||
#ifndef WIN32CON
|
#ifndef WIN32CON
|
||||||
/* this is used as a printf() replacement when the window
|
/* this is used as a printf() replacement when the window
|
||||||
@@ -92,7 +92,7 @@ VA_DECL(const char *, fmt)
|
|||||||
VA_END();
|
VA_END();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* WIN32CON */
|
||||||
|
|
||||||
char
|
char
|
||||||
switchar(void)
|
switchar(void)
|
||||||
@@ -328,6 +328,7 @@ interject_assistance(int num, int interjection_type, genericptr_t ptr1, genericp
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
nhUse(interjection_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -412,6 +413,7 @@ void port_insert_pastebuf(char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32CON
|
#ifdef WIN32CON
|
||||||
|
#if 0
|
||||||
static HWND
|
static HWND
|
||||||
GetConsoleHandle(void)
|
GetConsoleHandle(void)
|
||||||
{
|
{
|
||||||
@@ -451,8 +453,9 @@ GetConsoleHwnd(void)
|
|||||||
/* printf("%d iterations\n", iterations); */
|
/* printf("%d iterations\n", iterations); */
|
||||||
return hwndFound;
|
return hwndFound;
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
#endif /* WIN32CON */
|
#endif /* WIN32CON */
|
||||||
#endif
|
#endif /* RUNTIME_PASTEBUF_SUPPORT */
|
||||||
|
|
||||||
#ifdef RUNTIME_PORT_ID
|
#ifdef RUNTIME_PORT_ID
|
||||||
/*
|
/*
|
||||||
@@ -748,7 +751,7 @@ sys_random_seed(void)
|
|||||||
time_t datetime = 0;
|
time_t datetime = 0;
|
||||||
const char *emsg;
|
const char *emsg;
|
||||||
|
|
||||||
if (status == STATUS_NOT_FOUND)
|
if (status == (NTSTATUS) STATUS_NOT_FOUND)
|
||||||
emsg = "BCRYPT_RNG_ALGORITHM not avail, falling back";
|
emsg = "BCRYPT_RNG_ALGORITHM not avail, falling back";
|
||||||
else
|
else
|
||||||
emsg = "Other failure than algorithm not avail";
|
emsg = "Other failure than algorithm not avail";
|
||||||
@@ -796,11 +799,11 @@ struct CRctxt {
|
|||||||
} ctxp_ = { NULL, NULL, NULL, 0, 0, 0, NULL, 0 };
|
} ctxp_ = { NULL, NULL, NULL, 0, 0, 0, NULL, 0 };
|
||||||
struct CRctxt *ctxp = &ctxp_; // XXX should this now be in gc.* ?
|
struct CRctxt *ctxp = &ctxp_; // XXX should this now be in gc.* ?
|
||||||
|
|
||||||
#define win32err(fn) errname = fn; goto error
|
#define win32err(fn) errname = (char *) fn; goto error
|
||||||
|
|
||||||
int
|
int
|
||||||
win32_cr_helper(char cmd, struct CRctxt *contextp, void *p, int d){
|
win32_cr_helper(char cmd, struct CRctxt *contextp, void *p, int d){
|
||||||
char *errname = "unknown";
|
char *errname = (char *) "unknown";
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
default:
|
default:
|
||||||
/* Not panic - we don't want to upgrade an impossible to a
|
/* Not panic - we don't want to upgrade an impossible to a
|
||||||
@@ -960,8 +963,17 @@ printf("E2: M=%s e=%d\n",msg,errnum);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BACKTRACE
|
||||||
|
#define USED_IF_BACKTRACE
|
||||||
|
#else
|
||||||
|
#define USED_IF_BACKTRACE UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
win32_cr_gettrace(int maxframes, char *out, int outsize){
|
win32_cr_gettrace(int maxframes USED_IF_BACKTRACE,
|
||||||
|
char *out USED_IF_BACKTRACE,
|
||||||
|
int outsize USED_IF_BACKTRACE)
|
||||||
|
{
|
||||||
#ifdef USE_BACKTRACE
|
#ifdef USE_BACKTRACE
|
||||||
userstate.error_count = 0;
|
userstate.error_count = 0;
|
||||||
userstate.good_count = 0;
|
userstate.good_count = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user