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

@ -214,7 +214,7 @@ void GetOpts(int argc, char *argv[]) {
}
void OnTerm(int sig) {
char tmp[15];
char tmp[21];
LOG("got %s", strsignal_r(sig, tmp));
g_shutdown = sig;
}
@ -231,12 +231,12 @@ void BlockIp(uint32_t ip) {
if (g_iptables) {
execve(g_iptables,
(char *const[]){
"iptables", //
"-t", "raw", //
"-I", g_chain, //
"-s", FormatIp(ip), //
"-j", "DROP", //
0, //
"iptables", //
"-t", "raw", //
"-I", (char *)g_chain, //
"-s", FormatIp(ip), //
"-j", "DROP", //
0, //
},
(char *const[]){0});
} else if (g_pfctl) {

View file

@ -629,7 +629,7 @@ int GetClaims(struct Claims *q, struct Claim *out, int len) {
// parses request uri query string and extracts ?name=value
static bool GetNick(char *inbuf, struct HttpMessage *msg, struct Claim *v) {
size_t i, n;
size_t i;
struct Url url;
void *f[2] = {0};
bool found = false;
@ -826,7 +826,6 @@ void *HttpWorker(void *arg) {
// connection loop
while (GetClient(&g_clients, &client)) {
struct Data d;
struct Url url;
ssize_t got, sent;
uint32_t ip, clientip;
int tok, inmsglen, outmsglen;
@ -1890,7 +1889,6 @@ void *Supervisor(void *arg) {
}
void CheckDatabase(void) {
int rc;
sqlite3 *db;
if (g_integrity) {
CHECK_SQL(DbOpen("db.sqlite3", &db));