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

@ -68,7 +68,6 @@ TEST(pthread_cancel, self_deferred_waitsForCancellationPoint) {
}
void *Worker(void *arg) {
int n;
char buf[8];
pthread_cleanup_push(OnCleanup, 0);
read(pfds[0], buf, sizeof(buf));
@ -224,8 +223,10 @@ void *CpuBoundWorker(void *arg) {
CheckStackIsAligned();
wouldleak = malloc(123);
wontleak1 = malloc(123);
(void)wontleak1;
pthread_cleanup_push(free, wontleak1);
wontleak2 = _gc(malloc(123));
(void)wontleak2;
ASSERT_EQ(0, pthread_setspecific(key, (void *)31337));
ASSERT_EQ(0, pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0));
#ifdef __x86_64__
@ -262,7 +263,6 @@ TEST(pthread_cancel, async) {
}
void *CancelSelfWorkerAsync(void *arg) {
char buf[8];
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
pthread_cleanup_push(OnCleanup, 0);
pthread_cancel(pthread_self());