From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30603 invoked by alias); 29 Mar 2010 22:54:12 -0000 Received: (qmail 30595 invoked by uid 22791); 29 Mar 2010 22:54:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=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; Mon, 29 Mar 2010 22:54:08 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 1F8601B4019 for ; Mon, 29 Mar 2010 22:54:06 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: fix printf format warning about non-string literal Date: Mon, 29 Mar 2010 22:54:00 -0000 Message-Id: <1269903237-11061-1-git-send-email-vapier@gentoo.org> 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: 2010-03/txt/msg01032.txt.bz2 This is the normal "passing a buffer straight to printf makes GCC warn". While we know this particular case is fine, the trend in this source tree is to fix this anyways to avoid the warnings. Signed-off-by: Mike Frysinger --- 2010-03-29 Mike Frysinger * sim-utils.c (sim_io_eprintf_cpu): Use %s with printf string. sim/common/sim-utils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index fb84eb3..9f9104e 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -170,7 +170,7 @@ sim_io_eprintf_cpu (sim_cpu *cpu, const char *fmt, ...) va_list ap; va_start (ap, fmt); - sim_io_eprintf (sd, sim_cpu_msg_prefix (cpu)); + sim_io_eprintf (sd, "%s", sim_cpu_msg_prefix (cpu)); sim_io_evprintf (sd, fmt, ap); va_end (ap); } -- 1.7.0.2