From patchwork Mon Sep 6 16:16:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 63947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F1A7DB7101 for ; Tue, 7 Sep 2010 02:17:09 +1000 (EST) Received: (qmail 13215 invoked by alias); 6 Sep 2010 16:17:07 -0000 Received: (qmail 13200 invoked by uid 22791); 6 Sep 2010 16:17:03 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL, BAYES_20, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 16:16:57 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 4A18C389; Mon, 6 Sep 2010 18:16:55 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hngifKn0frQ9; Mon, 6 Sep 2010 18:16:53 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 843E4388; Mon, 6 Sep 2010 18:16:53 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id o86GGqZk004281; Mon, 6 Sep 2010 18:16:52 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: Fix Tru64 UNIX bootstrap: use lbasename in toplev.c (output_stack_usage) Date: Mon, 06 Sep 2010 18:16:52 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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,