From patchwork Mon Aug 3 14:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 503202 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 72AE5140E42 for ; Tue, 4 Aug 2015 00:40:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=eEgwjB9N; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QxRwWnV5i5uF64I/difaxtQqUyjkBPbBekRPp6li066PFGnE4j P6MQ0kZe8PazaM4Akj1fG8geAviy72kq6XgdT1XpRv+pxd2mP/J1Yktgjb5drvMq 9N/9yO4kEdFp/h7P6Qz7abz6wL077qjdxxd3sqOBjHOLkfRQkWtdu6CP0= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=iLPCkASOJfXYIiJsBlrz4qolbSI=; b=eEgwjB9N2ZmGkzSwlRfZ 69BbwFe6CWS8B0FOZIOqMin2Gf5KTLU0ndfFYGV47upXgXVqU6jXk/N35VI4yJDW kszi4MDepYSfLMtf+WkdSuJ1evW0bbtmcufcbnlv+p42MPdvFbIECc3/8dS6utk1 04jrUc5uvRGDaxpIrQbHGZs= Received: (qmail 84628 invoked by alias); 3 Aug 2015 14:40:48 -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 84563 invoked by uid 89); 3 Aug 2015 14:40:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f50.google.com Received: from mail-qg0-f50.google.com (HELO mail-qg0-f50.google.com) (209.85.192.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 14:40:41 +0000 Received: by qged69 with SMTP id d69so89746947qge.0 for ; Mon, 03 Aug 2015 07:40:39 -0700 (PDT) X-Received: by 10.140.194.133 with SMTP id p127mr26432397qha.38.1438612839648; Mon, 03 Aug 2015 07:40:39 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id f11sm6970505qki.1.2015.08.03.07.40.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 07:40:39 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [gomp4] Fix ptx warning Message-ID: <55BF7D65.8000501@acm.org> Date: Mon, 3 Aug 2015 10:40:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 I've committed this to gomp4. I was reusing a size_t variable in a loop where unsigned would do, and fprintf got upset. nathan 2015-08-03 Nathan Sidwell * config/nvptx/mkoffload.c (process): Avoid printf formatting warning. Index: config/nvptx/mkoffload.c =================================================================== --- config/nvptx/mkoffload.c (revision 226504) +++ config/nvptx/mkoffload.c (working copy) @@ -225,16 +225,16 @@ access_check (const char *name, int mode static void process (FILE *in, FILE *out) { - size_t len; + size_t len = 0; const char *input = read_file (in, &len); const char *comma; id_map const *id; unsigned obj_count = 0; - size_t i; + unsigned ix; /* Dump out char arrays for each PTX object file. These are terminated by a NUL. */ - for (i = 0; i != len;) + for (size_t i = 0; i != len;) { char c; @@ -280,8 +280,8 @@ process (FILE *in, FILE *out) " const char *code;\n" " __SIZE_TYPE__ size;\n" "} ptx_objs[] = {"); - for (comma = "", i = 0; i != obj_count; comma = ",", i++) - fprintf (out, "%s\n\t{ptx_code_%u, sizeof (ptx_code_%u)}", comma, i, i); + for (comma = "", ix = 0; ix != obj_count; comma = ",", ix++) + fprintf (out, "%s\n\t{ptx_code_%u, sizeof (ptx_code_%u)}", comma, ix, ix); fprintf (out, "\n};\n\n"); /* Dump out variable idents. */