Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFC] Change OK: to ARI: for ARI rule ignore
Date: Wed, 22 Apr 2009 22:27:00 -0000	[thread overview]
Message-ID: <001901c9c399$81854fe0$848fefa0$@u-strasbg.fr> (raw)

   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  <muller.u-strasbg.fr>

	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 <time.h>
 
 #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 <dirent.h>		/* OK: dirent.h */
-# define NAMELEN(dirent) strlen ((dirent)->d_name)	/* OK: strlen d_name
*/
+# include <dirent.h>		/* 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 <sys/ndir.h>
 # 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
 


             reply	other threads:[~2009-04-22 22:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 22:27 Pierre Muller [this message]
2009-04-22 23:44 ` Tom Tromey
2009-04-23  6:51   ` Pierre Muller
2009-04-23 18:19     ` Tom Tromey
2009-04-24 23:26       ` Pierre Muller
2009-04-28 13:09         ` Daniel Jacobowitz
2009-05-01  8:18         ` Pierre Muller
2009-05-06 16:15           ` Joel Brobecker
2009-05-06 16:26             ` Pierre Muller
2009-04-23 16:42   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001901c9c399$81854fe0$848fefa0$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox