Skip to content

Commit

Permalink
Add more strict checking to C library compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Nov 20, 2024
1 parent 3681e32 commit 6744070
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 9 deletions.
2 changes: 2 additions & 0 deletions libc/ia16.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ AR=ia16-elf-ar
LD=ia16-elf-ld

CFLAGS=$(ARCH) $(INCLUDES) $(CDEFS) -Wall -Os $(MULTILIB)
CFLAGS+=-Wextra -Wtype-limits -Wno-unused-parameter -Wno-sign-compare
CFLAGS+=$(MULTILIB)
ASFLAGS=--32-segelf -mtune=i8086
LDFLAGS=-mtune=i8086
# Used in subdirs to quickly create a library archive without a symbol index
Expand Down
2 changes: 1 addition & 1 deletion libc/math/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIB ?= out.a

include $(TOPDIR)/libc/$(COMPILER).inc

CFLAGS += -I$(TOPDIR)/libc/math -D__BSD_VISIBLE
CFLAGS += -I$(TOPDIR)/libc/math -D__BSD_VISIBLE -Wno-type-limits

DOUBLE = \
s_floor.o \
Expand Down
5 changes: 4 additions & 1 deletion libc/stdio/sprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ sprintf(char *sp, const char *fmt, ...)
0,
(unsigned char *)(unsigned)-1,
-1,
_IOFBF | __MODE_WRITE}
_IOFBF | __MODE_WRITE,
{ 0,0,0,0,0,0,0,0 },
0
}
};

va_list ptr;
Expand Down
4 changes: 3 additions & 1 deletion libc/stdio/sscanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ sscanf(const char *str, const char *format, ...)
0,
(unsigned char *)(unsigned)-1,
-1,
_IOFBF | __MODE_READ
_IOFBF | __MODE_READ,
{ 0,0,0,0,0,0,0,0 },
0
}
};

Expand Down
4 changes: 3 additions & 1 deletion libc/stdio/stderr.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ FILE stderr[1] =
buferr,
buferr + sizeof(buferr),
2,
_IONBF | __MODE_WRITE | __MODE_IOTRAN
_IONBF | __MODE_WRITE | __MODE_IOTRAN,
{ 0,0,0,0,0,0,0,0 },
0
}
};
4 changes: 3 additions & 1 deletion libc/stdio/stdin.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ FILE stdin[1] =
bufin,
bufin + sizeof(bufin),
0,
_IOFBF | __MODE_READ | __MODE_IOTRAN
_IOFBF | __MODE_READ | __MODE_IOTRAN,
{ 0,0,0,0,0,0,0,0 },
0
}
};
6 changes: 4 additions & 2 deletions libc/stdio/stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ FILE stdout[1] =
bufout + sizeof(bufout),
1,
#ifdef __WATCOMC__
_IOLBF | __MODE_WRITE | __MODE_IOTRAN /* FIXME flush on exit to fix */
_IOLBF | __MODE_WRITE | __MODE_IOTRAN, /* FIXME flush on exit to fix */
#else
_IOFBF | __MODE_WRITE | __MODE_IOTRAN
_IOFBF | __MODE_WRITE | __MODE_IOTRAN,
#endif
{ 0,0,0,0,0,0,0,0 },
0
}
};
4 changes: 3 additions & 1 deletion libc/stdio/vsnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ vsnprintf(char *sp, size_t size, const char *fmt, va_list ap)
0,
(unsigned char *)(unsigned)-1,
-1,
_IOFBF | __MODE_WRITE
_IOFBF | __MODE_WRITE,
{ 0,0,0,0,0,0,0,0 },
0
}
};

Expand Down
4 changes: 3 additions & 1 deletion libc/stdio/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ vsprintf(char *sp, const char *fmt, va_list ap)
0,
(unsigned char *)(unsigned)-1,
-1,
_IOFBF | __MODE_WRITE
_IOFBF | __MODE_WRITE,
{ 0,0,0,0,0,0,0,0 },
0
}
};

Expand Down

0 comments on commit 6744070

Please sign in to comment.