From a4a20360e9df90bb8a0ed23d113ed5564882de8a Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 13 Feb 2017 18:23:43 +0100 Subject: fixes & cleanups - tccgen.c/tcc.h: allow function declaration after use: int f() { return g(); } int g() { return 1; } may be a warning but not an error see also 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6 - tccgen.c: redundant code related to inline functions removed (functions used anywhere have sym->c set automatically) - tccgen.c: make 32bit llop non-equal test portable (probably not on C67) - dynarray_add: change prototype to possibly avoid aliasing problems or at least warnings - lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed (has no effect) - tccpe: set SizeOfCode field (for correct upx decompression) - libtcc.c: fixed alternative -run invocation tcc "-run -lxxx ..." file.c (meant to load the library after file). Also supported now: tcc files ... options ... -run @ arguments ... --- tccpp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tccpp.c') diff --git a/tccpp.c b/tccpp.c index 8cc9510..0a2c09b 100644 --- a/tccpp.c +++ b/tccpp.c @@ -1566,7 +1566,7 @@ static CachedInclude *search_cached_include(TCCState *s1, const char *filename, e = tcc_malloc(sizeof(CachedInclude) + strlen(filename)); strcpy(e->filename, filename); e->ifndef_macro = e->once = 0; - dynarray_add((void ***)&s1->cached_includes, &s1->nb_cached_includes, e); + dynarray_add(&s1->cached_includes, &s1->nb_cached_includes, e); /* add in hash table */ e->hash_next = s1->cached_includes_hash[h]; s1->cached_includes_hash[h] = s1->nb_cached_includes; @@ -1665,7 +1665,7 @@ static void pragma_parse(TCCState *s1) if (tok != TOK_STR) goto pragma_err; file = tcc_strdup((char *)tokc.str.data); - dynarray_add((void ***)&s1->pragma_libs, &s1->nb_pragma_libs, file); + dynarray_add(&s1->pragma_libs, &s1->nb_pragma_libs, file); next(); if (tok != ')') goto pragma_err; @@ -1820,7 +1820,7 @@ ST_FUNC void preprocess(int is_bof) printf("%s: including %s\n", file->prev->filename, file->filename); #endif /* update target deps */ - dynarray_add((void ***)&s1->target_deps, &s1->nb_target_deps, + dynarray_add(&s1->target_deps, &s1->nb_target_deps, tcc_strdup(buf1)); /* push current file in stack */ ++s1->include_stack_ptr; -- cgit v1.3.1