From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15064 invoked by alias); 16 Oct 2007 12:41:48 -0000 Received: (qmail 15054 invoked by uid 22791); 16 Oct 2007 12:41:47 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 16 Oct 2007 12:41:40 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id AE30A18701B; Tue, 16 Oct 2007 14:46:14 +0200 (CEST) From: "Pierre Muller" To: "'Daniel Jacobowitz'" , Subject: [RFA] gdb_ari.sh changes to discard some file types for specific tests Date: Tue, 16 Oct 2007 13:56:00 -0000 Message-ID: <000f01c80ff1$e2943d80$a7bcb880$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us 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: 2007-10/txt/msg00419.txt.bz2 UCASE and EditCase tests are currently polluted by lex and yacc files. This patch discards those bugs if the source is a lex or yacc source. The patch also contains the fixes for xasprintf and xvasprintf that I already proposed yesterday. I am new to AWK scripts, so I am unsure if my changes are standard. Is this OK? Pierre Muller Pseudo ChangeLog: 2007-10-16 Pierre Muller * gdb_ari.sh (is_yacc_or_lex): New variable. (FNR == 1): Set is_yacc_or_lex according to FILENAME pattern matching; (UCASE): Discard error if is_yacc_or_lex is set. (editCase): Ditto. Give more precise documentation. (xasprintf): Add known entries in defs.h and utils.c. Switch to regression category. (xvasprintf): Idem. $ cvs diff -up gdb_ari.sh Index: gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.75 diff -u -p -r1.75 gdb_ari.sh --- gdb_ari.sh 10 Oct 2007 11:56:14 -0000 1.75 +++ gdb_ari.sh 16 Oct 2007 12:34:18 -0000 @@ -172,6 +172,13 @@ function fail(bug,supplement) { FNR == 1 { seen[FILENAME] = 1 + if (match(FILENAME, "\\.[ly]$") || match(FILENAME, "-lex\\.c")) { + # FILENAME is a lex or yacc source, or a C file generated by lex + is_yacc_or_lex = 1 + } + else { + is_yacc_or_lex = 0 + } } END { if (print_idx) { @@ -455,15 +462,19 @@ Function name is uppercase." category["UCASE function"] = ari_code } /^[A-Z][[:alnum:]_]*[[:space:]]*\(/ { - fail("UCASE function") + if (is_yacc_or_lex == 0) { + fail("UCASE function") + } } BEGIN { doc["editCase function"] = "\ -Function name is uppercase." +Function name starts lower case but has uppercased letters." category["editCase function"] = ari_code } -/^[a-z][a-z0-0_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\(/ { - fail("editCase function") +/^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\(/ { + if (is_yacc_or_lex == 0) { + fail("editCase function") + } } BEGIN { doc["hash"] = "\ @@ -1300,7 +1311,9 @@ Do not use vasprintf(), instead use xstr BEGIN { doc["xasprintf"] = "\ Do not use xasprintf(), instead use xstrprintf" - category["xasprintf"] = ari_code + fix("xasprintf", "gdb/defs.h", 1) + fix("xasprintf", "gdb/utils.c", 1) + category["xasprintf"] = ari_regression } /(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ { fail("xasprintf") @@ -1308,7 +1321,9 @@ Do not use xasprintf(), instead use xstr BEGIN { doc["xvasprintf"] = "\ Do not use xvasprintf(), instead use xstrvprintf" - category["xvasprintf"] = ari_code + fix("xvasprintf", "gdb/defs.h", 1) + fix("xvasprintf", "gdb/utils.c", 1) + category["xvasprintf"] = ari_regression } /(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ { fail("xvasprintf")