History

update clang warning

herman ten brugge committed 5 years ago

Commit 9d498831 parent ea82d081 file · +4 −7Browse files

Unified · Split

tccelf.c+4−7
@@ -2501,10 +2501,7 @@ static int elf_output_file(TCCState *s1, const char *filename) · 2500 unmodified lines
25012501 {
25022502 int i, ret, phnum, phfill, shnum, file_type, file_offset, *sec_order;
25032503 struct dyn_inf dyninf = {0};
2504− struct ro_inf roinf;
2505−#if !TARGETOS_FreeBSD && !TARGETOS_NetBSD && !defined(__APPLE__) && !defined(_WIN32)
2506− struct ro_inf *roinf_use = NULL;
2507−#endif
2504+ struct ro_inf roinf, *roinf_use = &roinf;
25082505 ElfW(Phdr) *phdr;
25092506 Section *strsec, *interp, *dynamic, *dynstr, *note = NULL;
25102507
@@ -2640,11 +2637,11 @@ static int elf_output_file(TCCState *s1, const char *filename) · 129 unmodified lines
26402637
26412638 #if !TARGETOS_FreeBSD && !TARGETOS_NetBSD && !defined(__APPLE__) && !defined(_WIN32)
26422639 /* GNU_RELRO */
2643− if (file_type != TCC_OUTPUT_OBJ) {
2640+ if (file_type != TCC_OUTPUT_OBJ)
26442641 phnum++;
2645− roinf_use = &roinf;
2646− }
2642+ else
26472643 #endif
2644+ roinf_use = NULL;
26482645
26492646 /* allocate program segment headers */
26502647 phdr = tcc_mallocz(phnum * sizeof(ElfW(Phdr)));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t