diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index d1b6ac6ef..c83f85170 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -322,6 +322,7 @@ find_function (expr_t *fexpr, expr_t *params) memset (&type, 0, sizeof (type)); + type.type = ev_func; for (e = params; e; e = e->next) { if (e->type == ex_error) return e; diff --git a/tools/qfcc/test/file-line.r b/tools/qfcc/test/file-line.r new file mode 100644 index 000000000..3491f77f5 --- /dev/null +++ b/tools/qfcc/test/file-line.r @@ -0,0 +1,27 @@ +void printf (string fmt, ...) = #0; + +@overload void test (integer x) +{ + printf ("\"%s\" %s %d %s\n", + __PRETTY_FUNCTION__, __FUNCTION__, __LINE__, __FILE__); +} + +@overload void test (void) +{ + printf ("\"%s\" %s %d %s\n", + __PRETTY_FUNCTION__, __FUNCTION__, __LINE__, __FILE__); +} + +void foo (void) +{ + printf ("\"%s\" %s %d %s\n", + __PRETTY_FUNCTION__, __FUNCTION__, __LINE__, __FILE__); +} + +integer main () +{ + test (1); + test (); + foo (); + return 0; +} diff --git a/tools/qwaq/test.r b/tools/qwaq/test.r index 07110bf20..6bb07f6c3 100644 --- a/tools/qwaq/test.r +++ b/tools/qwaq/test.r @@ -34,7 +34,8 @@ -run { print ("Hello world\n"); - printf ("%i %p\n", self, &self.x); + printf ("%i %p [%s %s]\n", self, &self.x, [self description], + __PRETTY_FUNCTION__); return self; }