Fix warnings

This change fixes Cosmopolitan so it has fewer opinions about compiler
warnings. The whole repository had to be cleaned up to be buildable in
-Werror -Wall mode. This lets us benefit from things like strict const
checking. Some actual bugs might have been caught too.
This commit is contained in:
Justine Tunney 2023-09-01 20:49:13 -07:00
parent e2b3c3618e
commit 0d748ad58e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
571 changed files with 1306 additions and 1888 deletions

View file

@ -1026,7 +1026,6 @@ struct t_op {
cosmopolitan § the unbourne shell » bss
*/
static int inter;
static char **argptr; /* argument list for builtin commands */
static char **gargv;
static char **t_wp;
@ -5747,7 +5746,7 @@ static void CompleteCommand(const char *p, const char *q, const char *b,
}
closedir(d);
}
free(path);
free((void *)path);
}
}
}
@ -5784,7 +5783,6 @@ static void CompleteFilename(const char *p, const char *q, const char *b,
static void ShellCompletion(const char *p, linenoiseCompletions *c) {
bool slashed;
const char *q, *b;
struct tblentry **pp, *cmdp;
for (slashed = false, b = p, q = (p += strlen(p)); p > b; --p) {
if (p[-1] == '/' && p[-1] == '\\') slashed = true;
if (!isalnum(p[-1]) &&