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: 138947 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3983006lji; Mon, 18 Jun 2018 06:56:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLtNEmr9iczcIIH+wnuLX9Xs1ELIq/c31yYxO/EtbKOPkQt30kNkqRsnVE+OQjEyj5x8JrM X-Received: by 2002:a17:902:e00a:: with SMTP id ca10-v6mr14175925plb.224.1529330168813; Mon, 18 Jun 2018 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529330168; cv=none; d=google.com; s=arc-20160816; b=z6mffVmHos4Y+6/dO5IygWbNACz6MaUtGErZ4TafbLqvbcATXGEiqCWYECDZKefvA7 p0P0NAFgBd4MR2+QxApZmp8RQEK7MHNmDJAxgjibNXH1CSnohXHPm2f3ad7+Q0oDlQOw SFrFPq1GYA8j8pwTbb9P2AYPpHaIkQPyHoLWM8yQdhNuxfw+DFwi5EEwnAg/RVaVQvl4 DqTsupwmelibMFvyY8JZFqyKVLSIzhU0csDbypqgYcVE4bWc9i4lJa5XZ1a11zkJBzsm W4JmfSezGb2qbKs9N/HMUMrw2qCjhXosp4BJRYLJhQJZ/MvtFDCBgro4DSIQLenKvlAs 1UYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=JFtP0i1pbyZlPzuctr9kFrEaSKqssgLv2vfNhFP+E1c=; b=EIqRw9d0hbwgutmYdvpmBIFONEN/EL1gRbuO9f7vy5/gJPg1+qIL7rcZGe/6Gl2vPC IXpyHQ73VkmKNydYnaUnLzoSax9KVtl+bpi2psqyBBRRB8nOuOHf1/bOCLD7ALHumoDb Q2lfuxDA3ElFmAFwMtJCUopOSi0bDLjIxqkRhpJL/ap8B2Y7UhZXEQiKtm15DeTWkUhi rUgUqWNOfDN0a5SlL9l+tejrfArkvMqAdTOjy3SJeO8LIDPP1xbVQZWLgPB/d9Qg4wXl hKdMzxuoVnQJOg9N/CSatVtLGYCfOq3LcKt+lZyrGvbyku4r5ibFdZazTbpgyUX4BVDt aX4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vWOkqiTo; spf=pass (google.com: domain of gcc-patches-return-479916-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-479916-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p15-v6si14895540plq.180.2018.06.18.06.56.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 06:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-479916-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vWOkqiTo; spf=pass (google.com: domain of gcc-patches-return-479916-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-479916-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=m1KHz9QivuFyXAgtb9RNMHaWuer5zlnYrHYA+iNxk1xMet LQCq7a1/5x+n8qTponsq5PECE6nXbUz6m3Tyrifx1rcrjnDzbDB7I4q4YsHwL+HQ O1iiAq3M9+l94oPJjbyAH1JpLURuJa8u1rEmh72km+U8NmH0U9GJtiQ0rAmkA= 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=vWOkqiToLlVtJa7GERjG hbw8AwpBVbKCoW1u/ZkfHOBX5Bw2e5qY51cx20Sed/fYgei3Qk4C2evETsDgu6zA McV2ZaVeJfvkl2Whxg/Og+UgjjhlGkKGwkGRnyMuCCFVs2d6zoa+YJx5UgbPTBzE Xe/zXqHcRusAkCsuCa4Wan0= 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-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)