From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26606 invoked by alias); 30 May 2011 19:59:33 -0000 Received: (qmail 26588 invoked by uid 22791); 30 May 2011 19:59:32 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_XS X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 May 2011 19:59:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 65CC42BAF61 for ; Mon, 30 May 2011 15:59:13 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2kS9xihZvipP for ; Mon, 30 May 2011 15:59:13 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 358562BAF5A for ; Mon, 30 May 2011 15:59:13 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7F782145615; Mon, 30 May 2011 12:59:10 -0700 (PDT) Date: Mon, 30 May 2011 19:59:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [ARI/commit] enhance suggestion in "sprintf" rule (was: "Re: [commit] Re: New ARI warning Sat May 28 01:53:47 UTC 2011") Message-ID: <20110530195910.GF2620@adacore.com> References: <201105301916.p4UJG4N2001438@glazunov.sibelius.xs4all.nl> <20110530185933.GD2620@adacore.com> <20110530192841.GA11867@host1.jankratochvil.net> <20110530195019.GE2620@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20110530195019.GE2620@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00691.txt.bz2 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 289 > [...] I'll update the ARI documentation to mention xsnprintf > as well - the xstrprintf suggestion really put me in target-lock mode, > and I failed to think beyond it... This is what I checked in. Incidently, I noticed a typo, which I also fixed (this is the second patch). -- Joel --b5gNqxB1S1yM7hjW Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ari-sprintf.diff" Content-length: 619 Index: gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.108 retrieving revision 1.109 diff -u -p -r1.108 -r1.109 --- gdb_ari.sh 21 Mar 2011 23:04:02 -0000 1.108 +++ gdb_ari.sh 30 May 2011 19:53:25 -0000 1.109 @@ -1068,7 +1068,7 @@ Replace set_register_cached() with nothi # or safely allocate a fresh buffer. BEGIN { doc["sprintf"] = "\ -Do not use sprintf, instead use xstrprintf" +Do not use sprintf, instead use xsnprintf or xstrprintf" category["sprintf"] = ari_code } /(^|[^_[:alnum:]])sprintf[[:space:]]*\(/ { --b5gNqxB1S1yM7hjW Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ari-vsprint.diff" Content-length: 803 Index: gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.109 retrieving revision 1.110 diff -u -p -r1.109 -r1.110 --- gdb_ari.sh 30 May 2011 19:53:25 -0000 1.109 +++ gdb_ari.sh 30 May 2011 19:55:37 -0000 1.110 @@ -1075,12 +1075,12 @@ Do not use sprintf, instead use xsnprint fail("sprintf") } -BEGIN { doc["vsprint"] = "\ -Do not use vsprint(), instead use xstrvprintf" - category["vsprint"] = ari_regression +BEGIN { doc["vsprintf"] = "\ +Do not use vsprintf(), instead use xstrvprintf" + category["vsprintf"] = ari_regression } -/(^|[^_[:alnum:]])vsprint[[:space:]]*\(/ { - fail("vsprint") +/(^|[^_[:alnum:]])vsprintf[[:space:]]*\(/ { + fail("vsprintf") } BEGIN { doc["asprintf"] = "\ --b5gNqxB1S1yM7hjW--