configure: cleanup
- add quotes: eval opt=\"$opt\"
- use $source_path/conftest.c for OOT build
- add fn_makelink() for OOT build
- do not check lddir etc. on Windows/MSYS
- formatting
config-print.c
- rename to conftest.c (for consistency)
- change option e to b
- change output from that from "yes" to "no"
- remove inttypes.h dependency
- simpify version output
Makefile:
- improve GCC warning flag checks
tcc.h:
- add back default CONFIG_LDDIR
- add default CONFIG_TCCDIR also (just for fun)
tccpp.c:
- fix Christian's last warning
tccpp.c: In function ‘macro_subst’:
tccpp.c:2803:12: warning: ‘*((void *)&cval+4)’ is used uninitialized
in this function [-Wuninitialized]
That the change fixes the warning doesn't make sense but anyway.
libtcc.c:
- tcc_error/warning: print correct source filename/line for
token :paste: (also inline :asm:)
lddir and multiarch logic still needs fixing.
This commit is contained in:
25
libtcc.c
25
libtcc.c
@ -567,23 +567,24 @@ static void strcat_printf(char *buf, int buf_size, const char *fmt, ...)
|
||||
static void error1(TCCState *s1, int is_warning, const char *fmt, va_list ap)
|
||||
{
|
||||
char buf[2048];
|
||||
BufferedFile **f;
|
||||
BufferedFile **pf, *f;
|
||||
|
||||
buf[0] = '\0';
|
||||
if (file) {
|
||||
for(f = s1->include_stack; f < s1->include_stack_ptr; f++)
|
||||
strcat_printf(buf, sizeof(buf), "In file included from %s:%d:\n",
|
||||
(*f)->filename, (*f)->line_num);
|
||||
if (file->line_num > 0) {
|
||||
strcat_printf(buf, sizeof(buf),
|
||||
"%s:%d: ", file->filename, file->line_num);
|
||||
/* use upper file if inline ":asm:" or token ":paste:" */
|
||||
for (f = file; f && f->filename[0] == ':'; f = f->prev);
|
||||
if (f) {
|
||||
for(pf = s1->include_stack; pf < s1->include_stack_ptr; pf++)
|
||||
strcat_printf(buf, sizeof(buf), "In file included from %s:%d:\n",
|
||||
(*pf)->filename, (*pf)->line_num);
|
||||
if (f->line_num > 0) {
|
||||
strcat_printf(buf, sizeof(buf), "%s:%d: ",
|
||||
f->filename, f->line_num);
|
||||
} else {
|
||||
strcat_printf(buf, sizeof(buf),
|
||||
"%s: ", file->filename);
|
||||
strcat_printf(buf, sizeof(buf), "%s: ",
|
||||
f->filename);
|
||||
}
|
||||
} else {
|
||||
strcat_printf(buf, sizeof(buf),
|
||||
"tcc: ");
|
||||
strcat_printf(buf, sizeof(buf), "tcc: ");
|
||||
}
|
||||
if (is_warning)
|
||||
strcat_printf(buf, sizeof(buf), "warning: ");
|
||||
|
||||
Reference in New Issue
Block a user