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

@ -28,6 +28,7 @@
#include "libc/calls/syscall-sysv.internal.h"
#include "libc/calls/ucontext.h"
#include "libc/errno.h"
#include "libc/intrin/describeflags.internal.h"
#include "libc/intrin/kprintf.h"
#include "libc/log/internal.h"
#include "libc/log/log.h"
@ -132,9 +133,10 @@ static bool AppendFileLine(struct Buffer *b, const char *addr2line,
sys_close(pfd[0]);
sys_dup2(pfd[1], 1, 0);
sys_close(2);
__sys_execve(addr2line,
(char *const[]){addr2line, "-pifCe", debugbin, buf, 0},
(char *const[]){0});
__sys_execve(
addr2line,
(char *const[]){(char *)addr2line, "-pifCe", (char *)debugbin, buf, 0},
(char *const[]){0});
_Exit(127);
}
sys_close(pfd[1]);
@ -202,7 +204,7 @@ relegated void __oncrash_arm64(int sig, struct siginfo *si, void *arg) {
(ctx->uc_mcontext.sp & (GetStackSize() - 1)) <= getauxval(AT_PAGESZ)) {
kind = "Stack Overflow";
} else {
kind = GetSiCodeName(sig, si->si_code);
kind = DescribeSiCode(sig, si->si_code);
}
Append(b,
"%serror%s: Uncaught %G (%s) on %s pid %d tid %d\n"
@ -216,7 +218,6 @@ relegated void __oncrash_arm64(int sig, struct siginfo *si, void *arg) {
names.release);
if (ctx) {
long pc;
char line[256];
char *mem = 0;
size_t memsz = 0;
int addend, symbol;