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

@ -1,7 +1,8 @@
/* clang-format off */
FPI *fpi, fpi1;
FPI fpi1;
int Rounding;
const FPI *fpi;
Rounding = FLT_ROUNDS;
fpi = &fpi0;
if (Rounding != FPI_Round_near) {

View file

@ -128,7 +128,6 @@ __gdtoa_Balloc(int k, ThInfo **PTI)
{
int x;
Bigint *rv;
unsigned int len;
ThInfo *TI;
if (!(TI = *PTI))
*PTI = TI = __gdtoa_get_TI();

View file

@ -67,7 +67,8 @@ int
strtord(const char *s, char **sp, int rounding, double *d)
{
static const FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI, 0 /*unused*/ };
FPI *fpi, fpi1;
FPI fpi1;
const FPI *fpi;
ULong bits[2];
Long exp;
int k;

View file

@ -165,7 +165,8 @@ int
strtordd(const char *s, char **sp, int rounding, double *dd)
{
static const FPI fpi0 = { 106, 1-1023-53+1, 2046-1023-106+1, 1, 0, 0 /*unused*/ };
FPI *fpi, fpi1;
FPI fpi1;
const FPI *fpi;
ULong bits[4];
Long exp;
int k;

View file

@ -63,7 +63,8 @@ int
strtorf(const char *s, char **sp, int rounding, float *f)
{
static const FPI fpi0 = { 24, 1-127-24+1, 254-127-24+1, 1, SI, 0 /*unused*/ };
FPI *fpi, fpi1;
FPI fpi1;
const FPI *fpi;
ULong bits[1];
Long exp;
int k;

View file

@ -74,7 +74,8 @@ int
strtorx(const char *s, char **sp, int rounding, void *L)
{
static const FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI, 0 /*unused*/ };
FPI *fpi, fpi1;
FPI fpi1;
const FPI *fpi;
ULong bits[2];
Long exp;
int k;