mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-26 03:50:07 +08:00
fix warnings with tcc_add/get_symbol
This commit is contained in:
parent
67aebdd5b7
commit
40f5ce002e
@ -940,7 +940,7 @@ int tcc_load_coff(TCCState * s1, int fd)
|
|||||||
if (name[0] == '_' && strcmp(name, "_main") != 0)
|
if (name[0] == '_' && strcmp(name, "_main") != 0)
|
||||||
name++;
|
name++;
|
||||||
|
|
||||||
tcc_add_symbol(s1, name, csym.n_value);
|
tcc_add_symbol(s1, name, (void*)csym.n_value);
|
||||||
}
|
}
|
||||||
// skip any aux records
|
// skip any aux records
|
||||||
|
|
||||||
|
2
tccelf.c
2
tccelf.c
@ -177,7 +177,7 @@ void *tcc_get_symbol(TCCState *s, const char *name)
|
|||||||
if (!sym_index)
|
if (!sym_index)
|
||||||
return NULL;
|
return NULL;
|
||||||
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
||||||
return (void*)sym->st_value;
|
return (void*)(long)sym->st_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *tcc_get_symbol_err(TCCState *s, const char *name)
|
void *tcc_get_symbol_err(TCCState *s, const char *name)
|
||||||
|
Loading…
Reference in New Issue
Block a user