From patchwork Mon Jun 18 13:55:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 930868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479916-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="yo2EJ044"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418XgT4wh2z9s2t for ; Mon, 18 Jun 2018 23:56:04 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=sXsg+2XiNOs6j7qxflCTcYnIrDqDXNxTTMBJ932hj7xMpy 58BV7kNASSUurGrxUWAarCStW9fAqU13Q6ITWqfwJzaD1R8DqORCcEAQM1/8My8P OFjFjybq0AAKDsyoDfUy4EIY/meQZ+88q16asXWaLpuBYhVIFzKKNCC/INau8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=51TniBt32EBUJjaZRpMh4pIyEBk=; b=yo2EJ04416vfHboDk8e4 OWWvJfDfLeTVN9f4KdJh5FQqSWvYbDkUMSh8e9r2fnMr7PrTM1jfDJqE10tGgsAY jVqlVemgAtv+chAvrV9J/304xP/bP9sZWjjiCh3SQIJCHAfCifkfn/DjNtqxMGv7 kMep++iGk1e8BOfqZ8pFu98= Received: (qmail 7287 invoked by alias); 18 Jun 2018 13:55:57 -0000 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 Received: (qmail 7249 invoked by uid 89); 18 Jun 2018 13:55:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Jun 2018 13:55:55 +0000 Received: by mail-wr0-f181.google.com with SMTP id f16-v6so16969332wrm.3 for ; Mon, 18 Jun 2018 06:55:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=E8oFDp90MVq5zoHAFHXtI3Jigam3y7MbDhesJ0IjOf0=; b=tctaYqTdsyesRYOaPkLfVOeQwTL/UraTvjczk8ZN6mrEPv3pXjjPuvd+wTzHfKRSp4 RfZ/BPBGJdLYV6/7TqgXUXkGq+Dgj2lxMDYuIP6N2QXHlkRx4mclK4anVXT3emF/JQjE YI8fHtzFRUzyIH9VVKd1/oZuQ3KpZAVz5Gnp6TLUpMunwXrStoyIxwuhXslqlIxrvlqS wVpHRNFvDo/TcO2gKqPJibDgMkh7Rn4DY5FgAES1KGzcnSrz+3JWKr+f47MsLtTEXbsA A/hDwEJx1N+nr2KrO+E3XpQIYsj0eYNbB3B4cNuciFqaoD+9UHEqhxgGDYO/D4E44CE1 JzBQ== X-Gm-Message-State: APt69E02gOLGeYHejlU2RA5JxqfYh3DMCOxEEc/2mpmPPgb2kp52wzkr bOolWNKJborOIvDUnvjcOc+9wNNQ+fupU+MsCJHqZ7Yt8zQ= X-Google-Smtp-Source: ADUXVKLXUVwjwZAJr0d7qEK2X/AokZdbhidUTTWtFZPzhSeToaf+upE4sleKLK8HhxK1RWSFd2JW2TdPentEZ4vQXWg= X-Received: by 2002:adf:f5c8:: with SMTP id k8-v6mr9926050wrp.219.1529330153060; Mon, 18 Jun 2018 06:55:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:a782:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 06:55:52 -0700 (PDT) From: Prathamesh Kulkarni Date: Mon, 18 Jun 2018 19:25:52 +0530 Message-ID: Subject: [tree.c] Replace cast to (char *) by const_cast To: gcc Patches , nickc@redhat.com X-IsSubscribed: yes Hi, I am getting the following build error with trunk: ../../gcc/gcc/tree.c: In member function ‘void escaped_string::escape(const char*)’: ../../gcc/gcc/tree.c:12457:20: error: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Werror=cast-qual] m_str = (char *) unescaped; ^~~~~~~~~ I think this is caused by r261697 in tree.c: m_str = (char *) unescaped; The patch changes it to const_cast (unescaped) which fixes the build for me. OK to commit ? Thanks, Prathamesh diff --git a/gcc/tree.c b/gcc/tree.c index 6728f1c..889d88c 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -12454,7 +12454,7 @@ escaped_string::escape (const char *unescaped) if (m_owned) free (m_str); - m_str = (char *) unescaped; + m_str = const_cast (unescaped); m_owned = false; if (unescaped == NULL || *unescaped == 0)