From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9875 invoked by alias); 15 Nov 2015 08:21:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 9862 invoked by uid 89); 15 Nov 2015 08:21:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: julia1.inet.fi Received: from mta-out1.inet.fi (HELO julia1.inet.fi) (62.71.2.232) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Nov 2015 08:21:40 +0000 Received: from ap.localhost.localdomain (84.249.219.59) by julia1.inet.fi (9.0.002.03-2-gbe5d057) (authenticated as pavean-2) id 5613C7B10107A6AF; Sun, 15 Nov 2015 10:20:02 +0200 From: Andris Pavenis Subject: [PATCH] Fix inconsistent use of integer types in gcc/lto-streamer-out.c To: GCC Patches , DJ Delorie Message-ID: <5648408B.9040107@iki.fi> Date: Sun, 15 Nov 2015 08:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000102030800000904080309" X-SW-Source: 2015-11/txt/msg01862.txt.bz2 This is a multi-part message in MIME format. --------------000102030800000904080309 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 710 This fixes use of pointers different unsigned integer types as function parameter. Function prototype is (see gcc/tree-streamer.h): bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree, unsigned *); gcc/lto-streamer-out.c passes uint32_t int * as parameter to this method in 2 places. Current type unisgned is used elsewhere in the same file. uint32_t is not guaranteed to be the same as unsigned (for DJGPP uint32_t is actually unsigned long). That causes compile failure for DJGPP native build. Andris 2015-11-15 Andris Pavenis * gcc/lto-streamer-out.c (write_global_references): Adjust integer type (lto_output_decl_state_refs): Likewise --------------000102030800000904080309 Content-Type: text/x-patch; name="0001-lto-streamer-out.c-Fix-inconsistent-use-unsigned-int.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-lto-streamer-out.c-Fix-inconsistent-use-unsigned-int.pa"; filename*1="tch" Content-length: 1174 >From 8962f5b60f3ea241634a5e50cda04dc17ebb1322 Mon Sep 17 00:00:00 2001 From: Andris Pavenis Date: Sun, 15 Nov 2015 09:57:24 +0200 Subject: [PATCH] lto-streamer-out.c: Fix inconsistent use unsigned integer types * lto-streamer-out (write_global_references, lto_output_decl_state_streams): use integer type passed to streamer_tree_cache_lookup. --- gcc/lto-streamer-out.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 11daf7a..7d008b5 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2402,7 +2402,7 @@ write_global_references (struct output_block *ob, for (index = 0; index < size; index++) { - uint32_t slot_num; + unsigned slot_num; t = lto_tree_ref_encoder_get_tree (encoder, index); streamer_tree_cache_lookup (ob->writer_cache, t, &slot_num); @@ -2437,7 +2437,7 @@ lto_output_decl_state_refs (struct output_block *ob, struct lto_out_decl_state *state) { unsigned i; - uint32_t ref; + unsigned ref; tree decl; /* Write reference to FUNCTION_DECL. If there is not function, -- 2.4.3 --------------000102030800000904080309--