From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19089 invoked by alias); 2 Jan 2011 08:09:47 -0000 Received: (qmail 19081 invoked by uid 22791); 2 Jan 2011 08:09:45 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Jan 2011 08:09:40 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0D7B61B402E; Sun, 2 Jan 2011 08:09:37 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: toolchain-devel@blackfin.uclinux.org Subject: [PATCH] sim: tweak load buffer type to avoid signed warnings Date: Sun, 02 Jan 2011 08:09:00 -0000 Message-Id: <1293955743-14564-1-git-send-email-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00026.txt.bz2 The sim_load_file func creates a buffer with arbitrary data in it (reads it via the bfd). It then passes it on to a sim_write_fn which expects a unsigned char buffer. Since sim_load_file itself doesn't care about the contents, tweak the type to avoid signed mismatch warnings from gcc: common/sim-load.c: In function ‘sim_load_file’: common/sim-load.c:143: warning: pointer targets in passing argument 3 of ‘do_write’ differ in signedness common/sim-load.c:143: note: expected ‘const unsigned char *’ but argument is of type ‘char *’ Signed-off-by: Mike Frysinger 2011-01-02 Mike Frysinger * sim-load.c (sim_load_file): Change buffer type to unsigned char *. --- sim/common/sim-load.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c index b265cd9..9b3b809 100644 --- a/sim/common/sim-load.c +++ b/sim/common/sim-load.c @@ -111,7 +111,7 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write) size = bfd_get_section_size (s); if (size > 0) { - char *buffer; + unsigned char *buffer; bfd_vma lma; buffer = malloc (size); -- 1.7.3.1