mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +00:00
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:
parent
e2b3c3618e
commit
0d748ad58e
571 changed files with 1306 additions and 1888 deletions
|
@ -49,6 +49,8 @@
|
|||
// see tool/hello/hello-pe.c for an example program this can link
|
||||
// make -j8 m=tiny o/tiny/tool/hello/hello-pe.com
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
|
||||
#define VERSION \
|
||||
"elf2pe v0.1\n" \
|
||||
"copyright 2023 justine tunney\n" \
|
||||
|
@ -273,7 +275,6 @@ static void RelocateRela(struct Elf *elf, struct Segment *segment,
|
|||
RelocateVaddrWithinSegment(elf, rela->r_offset, segment);
|
||||
Elf64_Addr symbol_vaddr = elf->symtab[ELF64_R_SYM(rela->r_info)].st_value;
|
||||
char *place_ptr = segment->ptr_new + (place_vaddr - segment->vaddr_new_min);
|
||||
Elf64_Sxword addend = rela->r_addend;
|
||||
switch (ELF64_R_TYPE(rela->r_info)) {
|
||||
case R_X86_64_NONE: // do nothing
|
||||
case R_X86_64_COPY: // do nothing
|
||||
|
@ -1032,7 +1033,6 @@ static struct ImagePointer GeneratePe(struct Elf *elf, char *fp, int64_t vp) {
|
|||
|
||||
static void GetOpts(int argc, char *argv[]) {
|
||||
int opt;
|
||||
char *endptr;
|
||||
while ((opt = getopt(argc, argv, "ho:D:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'o':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue