[parisc-linux] __FUNCTION__ broken
Alan Modra
alan@linuxcare.com.au
Sat, 28 Oct 2000 13:55:13 +1100 (EST)
Hi Mark,
Your 2000-09-16 change doesn't clear c_function_name_declared_p
anywhere, resulting in empty strings for __FUNCTION__ and the like.
eg. testcase
cat > funcname.c <<EOF
extern int printf (__const char *__restrict __format, ...);
int foo (int x)
{
return x+1;
}
int main (void)
{
printf ("%s\n", __FUNCTION__);
return 0;
}
EOF
The following little patch seems to fix the problem, but please check
whether other cleaning up is required.
--- gcc/c-decl.c~ Thu Oct 26 16:20:36 2000
+++ gcc/c-decl.c Sat Oct 28 12:10:56 2000
@@ -6733,6 +6733,7 @@ finish_function (nested)
function. For a nested function, this value is used in
pop_c_function_context and then reset via pop_function_context. */
current_function_decl = NULL;
+ c_function_name_declared_p = 0;
}
}
Regards, Alan Modra
--
Linuxcare. Support for the Revolution.