From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24139 invoked by alias); 30 May 2011 19:29:13 -0000 Received: (qmail 24128 invoked by uid 22791); 30 May 2011 19:29:12 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_OC,TW_XS,T_FRT_PROFILE2,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 May 2011 19:28:58 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4UJSkM8032004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 May 2011 15:28:46 -0400 Received: from host1.jankratochvil.net (ovpn-113-38.phx2.redhat.com [10.3.113.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4UJSikV015577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 May 2011 15:28:45 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p4UJShXr016445; Mon, 30 May 2011 21:28:43 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p4UJSg2F016436; Mon, 30 May 2011 21:28:42 +0200 Date: Mon, 30 May 2011 19:29:00 -0000 From: Jan Kratochvil To: Joel Brobecker , Mark Kettenis Cc: gdb-patches@sourceware.org Subject: [commit] Re: New ARI warning Sat May 28 01:53:47 UTC 2011 Message-ID: <20110530192841.GA11867@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105301916.p4UJG4N2001438@glazunov.sibelius.xs4all.nl> <20110530185933.GD2620@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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-05/txt/msg00688.txt.bz2 On Mon, 30 May 2011 20:59:33 +0200, Joel Brobecker wrote: > That lead me to consider the removal of this rule. But in the end, > I think it's useful to be reminded every time we use sprintf that > there is xtrsprintf. Since this hasn't produced too many false > positives, I think it's OK to keep it for now. GCC already warns in appropriate cases for sprintf but I find the ARI rule sure useful in general. > If you put /* ARI: sprintf */ on the sprintf line, that should take > care of the warning... I did not know, thanks. On Mon, 30 May 2011 21:16:04 +0200, Mark Kettenis wrote: > Sorry, no. Please replace this with a call to xsnprintf. Done, when there are any concerns. Checked in. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2011-05/msg00245.html --- src/gdb/ChangeLog 2011/05/30 18:04:31 1.13065 +++ src/gdb/ChangeLog 2011/05/30 19:26:36 1.13066 @@ -1,3 +1,7 @@ +2011-05-30 Jan Kratochvil + + * linux-nat.c (linux_lwp_is_zombie): Use xsnprintf. + 2011-05-30 Pedro Alves * continuations.h (continuation_ftype): Add `err' parameter. --- src/gdb/linux-nat.c 2011/05/27 16:55:38 1.206 +++ src/gdb/linux-nat.c 2011/05/30 19:26:36 1.207 @@ -2365,7 +2365,7 @@ FILE *procfile; int retval = 0; - sprintf (buffer, "/proc/%ld/status", lwp); + xsnprintf (buffer, sizeof (buffer), "/proc/%ld/status", lwp); procfile = fopen (buffer, "r"); if (procfile == NULL) {