From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14330 invoked by alias); 22 Apr 2009 22:27:30 -0000 Received: (qmail 14320 invoked by uid 22791); 22 Apr 2009 22:27:29 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Apr 2009 22:27:24 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n3MMRGw9014056 for ; Thu, 23 Apr 2009 00:27:16 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n3MMRGIA043792 for ; Thu, 23 Apr 2009 00:27:16 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n3MMRFH1021482 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 23 Apr 2009 00:27:16 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: Subject: [RFC] Change OK: to ARI: for ARI rule ignore Date: Wed, 22 Apr 2009 22:27:00 -0000 Message-ID: <001901c9c399$81854fe0$848fefa0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2009-04/txt/msg00620.txt.bz2 Currently gdb_ari.sh ignores all lines containing either "/* OK ", "/* OK: " or "/* ARI: " patterns completely. When looking for occurrences of these patterns, I discovered that they were also sometimes used by people not really wanting to inform ARI to disregard this line, but simply to add a simple comment. Thus, I would like to restrict that rule to only accept /* ARI: rule_name */. My patches has two parts: one concerning gdb/utils.c and gdb/gdb_dirent.h sources with OK to ARI replacements, and a second patch for gdb_ari.sh that only recognizes ARI pattern and remembers the name of the rule and still parses the line for other possible warnings. The main problem if I commit both before next release is that, if ARI is rerun on gdb 6.8 release, this change will generate new false warnings. Thus, it is probably safer to postpone the second part of the patch to after next release. Comments? Pierre Muller ChangeLog entry: 2009-04-23 Pierre Muller ARI change: Use "/* ARI: rule */" pattern. * utils.c: Update ARI patterns. * gdb_dirent.h: Likewise. Index: utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.209 diff -u -p -r1.209 utils.c --- utils.c 15 Apr 2009 20:40:51 -0000 1.209 +++ utils.c 20 Apr 2009 16:18:44 -0000 @@ -68,10 +68,10 @@ #include #if !HAVE_DECL_MALLOC -extern PTR malloc (); /* OK: PTR */ +extern PTR malloc (); /* ARI: PTR */ #endif #if !HAVE_DECL_REALLOC -extern PTR realloc (); /* OK: PTR */ +extern PTR realloc (); /* ARI: PTR */ #endif #if !HAVE_DECL_FREE extern void free (); @@ -1201,7 +1201,7 @@ nomem (long size) /* NOTE: These are declared using PTR to ensure consistency with "libiberty.h". xfree() is GDB local. */ -PTR /* OK: PTR */ +PTR /* ARI: PTR */ xmalloc (size_t size) { void *val; @@ -1211,7 +1211,7 @@ xmalloc (size_t size) if (size == 0) size = 1; - val = malloc (size); /* OK: malloc */ + val = malloc (size); /* ARI: malloc */ if (val == NULL) nomem (size); @@ -1224,8 +1224,8 @@ xzalloc (size_t size) return xcalloc (1, size); } -PTR /* OK: PTR */ -xrealloc (PTR ptr, size_t size) /* OK: PTR */ +PTR /* ARI: PTR */ +xrealloc (PTR ptr, size_t size) /* ARI: PTR */ { void *val; @@ -1235,16 +1235,16 @@ xrealloc (PTR ptr, size_t size) /* OK: P size = 1; if (ptr != NULL) - val = realloc (ptr, size); /* OK: realloc */ + val = realloc (ptr, size); /* ARI: realloc */ else - val = malloc (size); /* OK: malloc */ + val = malloc (size); /* ARI: malloc */ if (val == NULL) nomem (size); return (val); } -PTR /* OK: PTR */ +PTR /* ARI: PTR */ xcalloc (size_t number, size_t size) { void *mem; @@ -1257,7 +1257,7 @@ xcalloc (size_t number, size_t size) size = 1; } - mem = calloc (number, size); /* OK: xcalloc */ + mem = calloc (number, size); /* ARI: xcalloc */ if (mem == NULL) nomem (number * size); @@ -1268,7 +1268,7 @@ void xfree (void *ptr) { if (ptr != NULL) - free (ptr); /* OK: free */ + free (ptr); /* ARI: free */ } Index: gdb_dirent.h =================================================================== RCS file: /cvs/src/src/gdb/gdb_dirent.h,v retrieving revision 1.8 diff -u -p -r1.8 gdb_dirent.h --- gdb_dirent.h 3 Jan 2009 05:57:51 -0000 1.8 +++ gdb_dirent.h 20 Apr 2009 16:18:44 -0000 @@ -21,11 +21,11 @@ /* See description of `AC_HEADER_DIRENT' in the Autoconf manual. */ #ifdef HAVE_DIRENT_H -# include /* OK: dirent.h */ -# define NAMELEN(dirent) strlen ((dirent)->d_name) /* OK: strlen d_name */ +# include /* ARI: dirent.h */ +# define NAMELEN(dirent) strlen ((dirent)->d_name) /* ARI: strlen d_name */ #else # define dirent direct -# define NAMELEN(dirent) (dirent)->d_namelen /* OK: d_namelen */ +# define NAMELEN(dirent) (dirent)->d_namelen /* ARI: d_namelen */ # ifdef HAVE_SYS_NDIR_H # include # endif Index: gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.89 diff -u -r1.89 gdb_ari.sh --- gdb_ari.sh 20 Apr 2009 15:55:23 -0000 1.89 +++ gdb_ari.sh 21 Apr 2009 22:31:36 -0000 @@ -147,6 +147,9 @@ exit } + if (ARI_OK == bug) { + exit + } # Trim the filename down to just DIRECTORY/FILE so that it can be # robustly used by the FIX code. @@ -206,7 +209,18 @@ /(^|[^_[:alnum:]])OBSOLETE([^_[:alnum:]]|$)/ { next; } # Skip OK lines -/\/\* OK \*\// || /\/\* OK: / || /\/\* ARI: / { next; } +/\/\* OK \*\// || /\/\* OK: / { + print "Skipping " FILENAME ":" FNR ":" $0 + next; +} + +/\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// { + ARI_OK = $1 +} +! /\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// { + ARI_OK = "" +} + # Things in comments