From patchwork Mon Sep 6 16:16:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix Tru64 UNIX bootstrap: use lbasename in toplev.c (output_stack_usage) From: Rainer Orth X-Patchwork-Id: 63947 Message-Id: To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Date: Mon, 06 Sep 2010 18:16:52 +0200 Mainline bootstrap is currently broken on alpha-dec-osf5.1b due to this patch: 2010-08-30 Eric Botcazou Stack usage support [...] * toplev.c (stack_usage_file): New file pointer. (output_stack_usage): New function. /vol/gcc/src/hg/trunk/local/gcc/toplev.c: In function 'output_stack_usage': /vol/gcc/src/hg/trunk/local/gcc/toplev.c:1647:5: error: passing argument 1 of 'basename' discards 'const' qualifier from pointer target type [-Werror] /vol/gcc/obj/regression/trunk/5.1b-gcc/build/./prev-gcc/include-fixed/string.h:174:18: note: expected 'char *' but argument is of type 'const char *' cc1: all warnings being treated as errors make[3]: *** [toplev.o] Error 1 In output_stack_usage(), basename is called with loc.file, which is const char *, while the prototype in expects a char *. I suppose other platforms aren't affected since they don't have the prototype in , but only in . To avoid eventual ripple effects from changing struct expanded_location.file to char *, I've chosen to simply use libiberty's lbasename function, which takes a const char *. Tru64 UNIX V5.1B bootstrap is now past the error, will commit as obvious once it completes. Rainer 2010-09-06 Rainer Orth * toplev.c (output_stack_usage): Use lbasename instead of basename. diff -r 9ee93616430f gcc/toplev.c --- a/gcc/toplev.c Fri Sep 03 19:11:43 2010 +0200 +++ b/gcc/toplev.c Mon Sep 06 18:16:03 2010 +0200 @@ -1644,7 +1644,7 @@ fprintf (stack_usage_file, "%s:%d:%d:%s\t"HOST_WIDE_INT_PRINT_DEC"\t%s\n", - basename (loc.file), + lbasename (loc.file), loc.line, loc.column, id,