From patchwork Tue Feb 26 18:16:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1048491 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-497066-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 4486TY2CkTz9s4Y for ; Wed, 27 Feb 2019 05:16:45 +1100 (AEDT) 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:cc:content-type; q=dns; s=default; b=DiqKNL3MmneeUn9O40JKQacXA2o442AxcxKmGhUHDnE L/hdL5i7pHRHhY+RxLiqxanyEadUxLtT9ZPlljSkuIWrlG9OFjrwqMUcgMKM4iQ1 C0LTdbIuIKkP0grQfYJgFqAvDdIPJmBc3AUD1lIaS8j5dqevAtbUGCYyxPQCAYSE = 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:cc:content-type; s=default; bh=Y/7nXGysBN6rBXcyjcLjqL0V5A4=; b=m9uA8cNdn5pWKWOt6 qyH+z00aRGFruKt75kUxRi1K1EVRMG9+MqxZp6jFJ/dFaBtkQQwQ369S4/33zV6H QeF9eBRHXmmaniy7tNwGEDf6PN506lk70Nyrc7FqWRVzJJD5ju9Tka6MypSvgHGP /hDwR76mj0u6np3HyvcRPHab7I= Received: (qmail 50330 invoked by alias); 26 Feb 2019 18:16:37 -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 50307 invoked by uid 89); 26 Feb 2019 18:16:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, 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-it1-f181.google.com Received: from mail-it1-f181.google.com (HELO mail-it1-f181.google.com) (209.85.166.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Feb 2019 18:16:35 +0000 Received: by mail-it1-f181.google.com with SMTP id l66so5609949itg.3; Tue, 26 Feb 2019 10:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=W93PZ+EH1QhmruTic0jugw7lh4qHt+g2Dj7bpQtJo8c=; b=bedNMfG2qiTUI3uDjBk/KxGeFo8EVKWjslE7t8w5Hi2HKz78w1H5+Ha2hIYOaAQjrY 0Sav/Y+llNzFc6jw2HmI7nqdfT+36509OS3nwKLDPqYSEHvRAtiA/P5uN8wXeHbrHMWW 6rfXGKDFq6BsxOtHo5PaGIuPzteZ9ER96AYQRU72H6OFayaSumYIlpwPvBts7KBioyo6 MdZ1WaqkPCcSWTpq8nBytQGSxi38CR/fN4ZVrAy+wxdbQlGzgl7dypHEv8S+td1MD/MF hYrSafJnomPpQeV+0WC9gh5ZDjBq5t73sKadR37ljyib8jQs72rOCAUqJkT7gCtE8m5u rMdA== MIME-Version: 1.0 From: Uros Bizjak Date: Tue, 26 Feb 2019 19:16:21 +0100 Message-ID: Subject: [PATCH, fortran]: Do not cast charlen to index type in transfer_array_inner To: "gcc-patches@gcc.gnu.org" Cc: Fortran List Attached patch removes following warning: libgfortran/io/transfer.c: In function ‘transfer_array_inner’: libgfortran/io/transfer.c:2499:35: warning: operand of ?: changes signedness from ‘long int’ to ‘size_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare] There is actually no need to cast "charlen" to (unsigned) index_type, as it is already declared as size_t: typedef size_t gfc_charlen_type; the same type as are "elem_len" and "size" variables. 2019-02-26 Uroš Bizjak * io/transfer.c (transfer_array_inner): Do not cast charlen to index type. Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. OK for mainline? Uros. Index: io/transfer.c =================================================================== --- io/transfer.c (revision 269217) +++ io/transfer.c (working copy) @@ -2496,7 +2496,7 @@ transfer_array_inner (st_parameter_dt *dtp, gfc_ar return; iotype = (bt) GFC_DESCRIPTOR_TYPE (desc); - size = iotype == BT_CHARACTER ? (index_type) charlen : GFC_DESCRIPTOR_SIZE (desc); + size = iotype == BT_CHARACTER ? charlen : GFC_DESCRIPTOR_SIZE (desc); rank = GFC_DESCRIPTOR_RANK (desc);