This is the mail archive of the gdbadmin@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cron <gdbadmin@sourceware> sh $HOME/ss/do-all-gdb-snapshots


===================================================================
Checking out src/gdb/version.in
RCS:  /sourceware/projects/src-home/cvsfiles/src/gdb/version.in,v
VERS: 1.241
***************

+ sh ./make-snapshot /sourceware/snapshot-tmp/current-insight+dejagnu-snapshot insight+dejagnu 20020210 -Q -d /cvs/src co -D 2002-02-10-gmt -P insight+dejagnu
make-snapshot insight+dejagnu current done

+ sh ./update-snapshot /sourceware/snapshot-tmp/current-insight+dejagnu-snapshot insight+dejagnu 20020210 /sourceware/ftp/anonftp/pub/gdb/snapshots/current
update-snapshot insight+dejagnu current done

+ sh ./make-snapshot /sourceware/snapshot-tmp/current-gdb+dejagnu-snapshot gdb+dejagnu 20020210 -Q -d /cvs/src co -D 2002-02-10-gmt -P gdb+dejagnu
make-snapshot gdb+dejagnu current done

+ sh ./update-snapshot /sourceware/snapshot-tmp/current-gdb+dejagnu-snapshot gdb+dejagnu 20020210 /sourceware/ftp/anonftp/pub/gdb/snapshots/current
update-snapshot gdb+dejagnu current done
===================================================================
Checking out src/gdb/version.in
RCS:  /sourceware/projects/src-home/cvsfiles/src/gdb/version.in,v
VERS: 1.52.2.111
***************

+ sh ./make-snapshot /sourceware/snapshot-tmp/5.1-branch-insight+dejagnu-snapshot insight+dejagnu 5.1.1 -Q -d /cvs/src co -D 2002-02-10-gmt -r gdb_5_1-2001-07-29-branch -P insight+dejagnu
make-snapshot insight+dejagnu 5.1-branch done

+ sh ./update-snapshot /sourceware/snapshot-tmp/5.1-branch-insight+dejagnu-snapshot insight+dejagnu 5.1.1 /sourceware/ftp/anonftp/pub/gdb/snapshots/5.1-branch
update-snapshot insight+dejagnu 5.1-branch done

+ sh ./make-snapshot /sourceware/snapshot-tmp/5.1-branch-gdb+dejagnu-snapshot gdb+dejagnu 5.1.1 -Q -d /cvs/src co -D 2002-02-10-gmt -r gdb_5_1-2001-07-29-branch -P gdb+dejagnu
make-snapshot gdb+dejagnu 5.1-branch done

+ sh ./update-snapshot /sourceware/snapshot-tmp/5.1-branch-gdb+dejagnu-snapshot gdb+dejagnu 5.1.1 /sourceware/ftp/anonftp/pub/gdb/snapshots/5.1-branch
update-snapshot gdb+dejagnu 5.1-branch done

+ sh ./update-web-ari /sourceware/ftp/anonftp/pub/gdb/snapshots/current/gdb+dejagnu.tar.bz2 /sourceware/snapshot-tmp/gdb+dejagnu-web-ari /www/sourceware/htdocs/gdb/ari gdb
Unpacking tar ball
Checking source code
awk: cmd. line:20: fatal error: internal error
./update-web-ari: line 1533:  8034 Broken pipe             find "${srcdir}/${project}" -name 'testsuite' -prune -o -name 'stop-gdb.c' -prune -o -name 'stuff.c' -prune -o -name '*-stub.c' -prune -o -name '*-share' -prune -o -name 'tui' -prune -o -name 'nlm' -prune -o -name 'gnu-regex.c' -prune -o -name 'gnu-regex.h' -prune -o -name '*\.tab\.c' -prune -o -name 'gdbserver' -prune -o -name '*.[hc]' -type f -print
      8036 Aborted                 | $AWK '
BEGIN {
    comment_p = 0
    string_p = 0
}

function fail (bug) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    if (fixit[bug, file] > 0) {
	fixit[bug, file] -= 1
    } else {
	print bug ":" 1 ":" level[bug] ":" file ":" FNR
	total[bug] += 1
    }
}

function bug (bug, file, count) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    # print bug ":" -count ":" level[bug] ":" file ":" 0
    fixit[bug, file] = count
}

# Load the list of files into an initially empty argument list.
# While STDIN is being parsed, ARGIND will remain zero.
ARGIND == 0 {
    ARGV[ARGC++] = $0;
    next;
}

# Initialize the PARSER
FNR == 1 {
    file = FILENAME;
    sub (/^.*\/'"${project}"'\//, "", file);
    file = "'"${project}"'/" file
    #printf " %s", file > "/dev/stderr";
    #fflush (/dev/stderr);
}

# Skip deprecated/obsolete lines
/(^|[^_[:alnum:]])DEPRECATED([^_[:alnum:]]|$)/ { next; }
/(^|[^_[:alnum:]])OBSOLETE([^_[:alnum:]]|$)/ { next; }

# Strip out comments
FNR == 1 { comment_p = 0; }
comment_p && /\*\// { gsub (/^([^\*]|\*+[^\/\*])*\*+\//, " "); comment_p = 0; }
comment_p { next; }
!comment_p { gsub (/\/\*([^\*]|\*+[^\/\*])*\*+\//, " "); }
!comment_p && /\/\*/ { gsub (/\/\*.*$/, " "); comment_p = 1; }

BEGIN { doc["error capital"] = "\
The error message should start with a capital but no one is sure of this"
    level["error capital"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^A-Z]*[^\/]"/ {
    fail("error capital")
}

BEGIN { doc["error full-stop"] = "\
The error message should not have a trailing full-stop"
    level["error full-stop"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^"]\."/ {
    fail("error full-stop")
}

# SNIP - Strip out strings - brain dead at present does not handle \" - SNIP

FNR == 1 { string_p = 0; }
string_p && /(^\"|[^\\]\")/ { gsub (/^([^\"]|\\\")*\"/, " "); string_p = 0; }
string_p { next; }
!string_p { gsub (/\"([^\"]|\\\")*\"/, " "); }
!string_p && /\"/ { gsub (/\"([^\"]|\\\")*$/, " "); string_p = 1; }

# Accumulate continuation lines
FNR == 1 { cont_p = 0; }
!cont_p { full_line = ""; }
/[^\\]\\$/ { gsub (/\\$/, ""); full_line = full_line $0; cont_p = 1; next; }
cont_p { $0 = full_line $0; cont_p = 0; full_line = ""; }


# GDB uses ISO C.  Check for any non pure ISO C code

BEGIN { doc["PARAMS"] = "\
Still uses the PARAMS macro.";
    level["PARAMS"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])PARAMS([^_[:alnum:]]|$)/ {
    fail("PARAMS")
}

BEGIN { doc["__STDC__"] = "\
GDB assumes ISO C, testing for __STDC__ makes little sense";
    level["__STDC__"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])__STDC__([^_[:alnum:]]|$)/ {
    fail("__STDC__")
}

BEGIN { doc["__CYGWIN32__"] = "\
__CYGWIN32__ has been replaced by __CYGWIN__ or, better, explicit \
autoconf tests";
    level["__CYGWIN32__"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])__CYGWIN32__([^_[:alnum:]]|$)/ {
    fail("__CYGWIN32__")
}

BEGIN { doc["PTR"] = "\
Use ``void *'\'\''.  PTR dates back to the days before ISO C.";
    level["PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])PTR([^_[:alnum:]]|$)/ {
    fail("PTR")
}

BEGIN { doc["CONST_PTR"] = "\
Use ``const void *'\'\''.  PTR dates back to the days before ISO C.";
    level["CONST_PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])CONST_PTR([^_[:alnum:]]|$)/ {
    fail("CONST_PTR")
}

BEGIN { doc["grep ^func"] = "\
A function declaration with the function name positioned at the very start \
of a line.  Only as part of the function definition should the function \
name appear at the very start of a line.  This is so that \
``grep ^func'\'\'' works";
    level["grep ^func"] = '$ARI_WARNING'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:blank:]]*[^\*].*\);[[:blank:]]*/ {
    # FYI, it matches:
    #NAME (...);
    # when a normal declaration would have:
    #TYPE NAME (...);
    fail("grep ^func")
}

BEGIN { doc["K&R defn"] = "\
Still uses old style K&R function definition (not declaration) \
This check is BUGGY.  It appears to also  match things like a declaration \
where the function name is at the start of a line."
    level["K&R defn"] = '$ARI_ERROR'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:alnum:]_]*[[:blank:]]*[,\)]/ && ! /\(void\)/ && ! /\);/ {
    fail("K&R defn")
}

BEGIN { doc["make_cleanup_func"] = "\
Type casting using make_cleanup_func is invalid ISO C";
    level["make_cleanup_func"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])make_cleanup_func([^_[:alnum:]]|$)/ {
    fail("make_cleanup_func")
}

BEGIN { doc["catch_errors_ftype"] = "\
Type casting using catch_errors_ftype is invalid ISO C";
    level["catch_errors_ftype"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors_ftype([^_[:alnum:]]|$)/ {
    fail("catch_errors_ftype")
}

BEGIN { doc["catch_errors"] = "\
Use catch_exceptions() in preference to catch_errors().";
    level["catch_errors"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors[[:space:]]*\(/ {
    fail("catch_errors")
}

BEGIN { doc["strerror"] = "\
Use safe_strerror() in preference to strerror().";
    level["strerror"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])strerror[[:space:]]*\(/ {
    fail("strerror")
}

BEGIN { doc["long long"] = "\
Change ``long long'\'\'' to ``LONGEST'\'\''.";
    level["long long"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])long[[:space:]]+long([^_[:alnum:]]|$)/ {
    fail("long long")
}

BEGIN { doc["ATTRIBUTE_UNUSED"] = "\
GDB is compiled with -Werror and, consequently, is not able to tolerate \
false warnings.  Since -Wunused-param produces such warnings, neither \
that warning flag nor ATTRIBUTE_UNUSED are used in GDB."
    level["ATTRIBUTE_UNUSED"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])ATTRIBUTE_UNUSED([^_[:alnum:]]|$)/ {
    fail("ATTRIBUTE_UNUSED")
}

# General problems

BEGIN { doc["_func"] = "\
The suffixes ..._func and ..._ftype are used inconsistently in the source. \
Perhaps just ..._ftype should be used.";
    level["_func"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])[[:alpha:]_][[:alnum:]_]*_func([^_[:alnum:]]|$)/ {
    fail("_func")
}

BEGIN { doc["TARGET_BYTE_ORDER_SELECTABLE"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_SELECTABLE"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_SELECTABLE/ {
    fail("TARGET_BYTE_ORDER_SELECTABLE")
}

BEGIN { doc["TARGET_BYTE_ORDER_DEFAULT"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_DEFAULT"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_DEFAULT/ {
    fail("TARGET_BYTE_ORDER_DEFAULT")
}

# Correct use of initialized?
BEGIN {
    doc["_initialize decl"] = "\
Declaration of _initialize*() missing.  The declaration stops a -Wmissing-declarations \
warning from GCC.";
    level["_initialize decl"] = '$ARI_INFO'
    doc["_initialize ftype"] = "\
Declaration of _initialize*() does not use initialize_file_ftype, should it?";
    level["_initialize ftype"] = '$ARI_INFO'
}
# Remember what type declaration, if any, we see
FNR == 1 {
    initialize_decl = 0;
    initialize_ftype = 0;
}
/^extern[[:space:]]+void[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_decl = 1
}
/^extern[[:space:]]+initialize_file_ftype[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_ftype = 1
}
# Check it against the definition
/^_initialize_[_[:alnum:]]*[[:space:]]+/ {
    if (!initialize_decl && !initialize_ftype) {
	fail("_initialize decl")
    }
    if (!initialize_ftype) {
	fail("_initialize ftype")
    }
}

# FIXME: Since strings are stripped, does this still work?
BEGIN { doc["error internal error"] = "\
Code should call the internal_error() function rather than print an \
internal-error message directly";
    level["error internal error"] = '$ARI_REGRESSION'
}
/error.*\"Internal error/ || /error.*\"internal error/ {
    fail("error internal error")
}

BEGIN { doc["inline"] = "\
Let the compiler decide if something needs to be made inline"
    level["inline"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {
    fail("inline")
}

BEGIN { doc["register"] = "\
Let the compiler decide if something needs to be made register"
    level["register"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])register([^_[:alnum:]]|$)/ {
    fail("register")
}

BEGIN { doc["return_to_top_level"] = "\
return_to_top_level() is deprecated in favor of the verror(), error_stream() \
et.al.";
    level["return_to_top_level"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])return_to_top_level[[:blank:]]*\(/ {
    fail("return_to_top_level")
}

BEGIN { doc["error_begin"] = "\
error_begin() is deprecated in favor of verror(), error_stream() et.al.";
    level["error_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])error_begin[[:blank:]]*\(/ {
    fail("error_begin")
}

BEGIN { doc["warning_begin"] = "\
warning_begin() is deprecated in favor of vwarning(), warning_stream() \
et.al. (see error_begin())";
    level["warning_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])warning_begin[[:blank:]]*\(/ {
    fail("warning_begin")
}

BEGIN { doc["sizeof (CORE_ADDR)"] = "\
CORE_ADDR is not the same size as the host/target address.  Use TARGET_PTR_BIT \
or TARGET_ADDR_BIT.";
    level["sizeof (CORE_ADDR)"] = '$ARI_WARNING'
}
/sizeof[[:blank:]]*(CORE_ADDR)/ {
    fail("sizeof (CORE_ADDR)")
}

BEGIN { doc["REGNO"] = "\
Use the ..._REGNUM instead of the ..._REGNO name suffix";
    level["REGNO"] = '$ARI_WARNING'
}
/_REGNO([^_[:alnum:]]|$)/ || /_regno([^_[:alnum:]]|$)/ {
    fail("REGNO")
}

BEGIN { doc["abort"] = "\
GDB should never abort - use internal_error()";
    level["abort"] = '$ARI_REGRESSION'
    bug("abort", "gdb/utils.c", 3)
}
/(^|[^_[:alnum:]])abort[[:blank:]]*\(/ {
    fail("abort")
}

BEGIN { doc["basename"] = "\
GDB should never basename - use ``const char *lbasename(const char *)'\'\''";
    level["basename"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])basename[[:blank:]]*\(/ {
    fail("basename")
}

BEGIN { doc["assert"] = "\
GDB should never use assert().  Assert() calls abort() and GDB should \
not abort.  Use internal_error() or gdb_assert() instead.";
    level["assert"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])assert[[:blank:]]*\(/ {
    fail("assert")
}

BEGIN { doc["sizeof CORE_ADDR"] = "\
Taking the sizeof a CORE_ADDR is potentially dangerous.  CORE_ADDR is at \
least as big as the target pointer, _not_ the same size."
    level["sizeof CORE_ADDR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sizeof[:blank:]*\(CORE_ADDR\)/ {
    fail("sizeof CORE_ADDR")
}

BEGIN { doc["CORE_ADDR cast"] = "\
Casting something to a CORE_ADDR is typically dangerous and non-portable. \
(The data from this pattern may be wrong)";
    level["CORE_ADDR cast"] = '$ARI_WARNING'
}
/\(CORE_ADDR\)[:blank:]*[^,);]/ {
    fail("CORE_ADDR cast")
}

BEGIN { doc["QUIT"] = "\
Uses QUIT which could be unsafe. Should it instead use ``if (QUIT_P ()) \
return ...;'\'\'' (which does not yet exist)."
    level["QUIT"] = '$ARI_INFO'
}
/QUIT[[:blank:]]*[^;]/ {
    fail("QUIT")
}

BEGIN { doc["quit_flag"] = "\
Uses ``quit_flag'\'\''.  Should it instead use ``if (QUIT_P ()) ...'\'\'' \
(which does not yet exist).";
    level["quit_flag"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])quit_flag([^_[:alnum:]]|$)/ {
    fail("quit_flag")
}

BEGIN { doc["extern"] = "\
An ``extern'\'\'' declaration appears in a .c file";
    level["extern"] = '$ARI_WARNING'
    bug("extern", "gdb/ser-go32.c", 1) # extern *environ;
}
/^[[:blank:]]*extern[[:blank:]]*/ && ! /_initialize_/ && file ~ /\.c$/ { 
    fail("extern")
}

BEGIN { doc["#define"] = "\
Delcare an enum in preference to define a macro. ???";
    level["#define"] = '$ARI_INFO'
}
/^[[:blank:]]*#define[[:blank:]]+[[:alnum:]_]+[[:blank:]]+/ {
    fail("#define")
}

BEGIN { doc["#if"] = "\
Use an if statement in preference to conditionally compiled code. ???";
    level["#if"] = '$ARI_INFO'
}
/^[[:blank:]]*#if/ && ! / HAVE_/ {
    fail("#if")
}

BEGIN { doc["GDBTK"] = "\
#ifdef GDBTK should not be needed.";
    level["GDBTK"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])GDBTK([^_[:alnum:]]|$)/ {
    fail("GDBTK")
}

BEGIN { doc["TUI"] = "\
#ifdef TUI should not be needed.";
    level["TUI"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])TUI([^_[:alnum:]]|$)/ {
    fail("TUI")
}

BEGIN { doc["HAVE_VFORK"] = "\
#ifdef HAVE_VFORK is redundant.  Include \"gdb_vfork.h\" and call vfork() \
unconditionally.";
    level["HAVE_VFORK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HAVE_VFORK([^_[:alnum:]]|$)/ {
    fail("HAVE_VFORK")
}

BEGIN { doc["DEBUG"] = "\
Nothing should depend on a macro like DEBUG"
    level["DEBUG"] = '$ARI_INFO'
}
/^#if.*DEBUG/ {
    fail("DEBUG")
}

BEGIN { doc["union"] = "\
The union construct always leads to problems...";
    level["union"] = '$ARI_INFO'
}
/[[:blank:]]*union[[:blank:]]*/ {
    fail("union")
}

BEGIN { doc["unsafe getpkt"] = "\
Function that can call longjmp.";
    level["unsafe getpkt"] = '$ARI_INFO'
}
/^[^_[:alnum:]]getpkt([^_[:alnum:]]|$)/ {
    fail("unsafe getpkt")
}

BEGIN { doc["unsafe error"] = "\
Function that can can call longjmp.";
    level["unsafe error"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])error[[:blank:]]*\(/ {
    fail("unsafe error")
}

BEGIN { doc["readchar"] = "\
Parameterise the remote serial read/write code with the serial device \
being read.";
    level["readchar"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])readchar[[:blank:]]*\(/ {
    fail("readchar")
}

BEGIN { doc["sigsetmask"] = "\
sigsetmask() is deprecated in favour of sigprocmask().";
    level["sigsetmask"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sigsetmask[[:blank:]]*\(/ {
    fail("sigsetmask")
}

BEGIN { doc["bcmp"] = "\
bcmp() is deprecated in favor of the ISO C function memcmp().";
    level["bcmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])bcmp[[:blank:]]*\(/ {
    fail("bcmp")
}

BEGIN { doc["bzero"] = "\
bzero() id deprecated in favour of the ISO C function memset().";
    level["bzero"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bzero[[:blank:]]*\(/ {
    fail("bzero")
}

BEGIN { doc["bcopy"] = "\
bcopy() id deprecated in favour of the ISO C functions memcpy() and \
memmove().";
    level["bcopy"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bcopy[[:blank:]]*\(/ {
    fail("bcopy")
}

BEGIN { doc["atoi"] = "\
Use strtol() instead of atoi().  The latter has a habit of accepting dud \
strings.";
    level["atoi"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])atoi[[:blank:]]*\(/ {
    fail("atoi")
}

BEGIN { doc["printf"] = "\
All GDB output should use the *printf*filtered() functions.";
    level["printf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])printf[[:blank:]]*\(/ {
    fail("printf")
}

BEGIN { doc["%p"] = "\
Use %s and paddr() to print target addresses, not %p.";
    level["%p"] = '$ARI_REGRESSION'
}
/%p/ {
    fail("%p")
}

BEGIN { doc["extract_floating"] = "\
GDB should use extract_typed_floating().";
    level["extract_floating"] = '$ARI_WARNING'
    bug("extract_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])extract_floating[[:blank:]]*\(/ {
    fail("extract_floating")
}

BEGIN { doc["store_floating"] = "\
GDB should use store_typed_floating().";
    level["store_floating"] = '$ARI_WARNING'
    bug("store_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])store_floating[[:blank:]]*\(/ {
    fail("store_floating")
}

BEGIN { doc["floatformat_to_double"] = "\
GDB should use floatformat_to_doublest().";
    level["floatformat_to_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_to_double[[:blank:]]*\(/ {
    fail("floatformat_to_double")
}

BEGIN { doc["floatformat_from_double"] = "\
GDB should use floatformat_from_doublest().";
    level["floatformat_from_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_from_double[[:blank:]]*\(/ {
    fail("floatformat_from_double")
}

BEGIN { doc["floatformat_arm_ext"] = "\
GDB should use floatformat_arm_big or floatformat_arm_littlebyte_bigword.";
    level["floatformat_arm_ext"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])floatformat_arm_ext([^_[:alnum:]]|$)/ {
    fail("floatformat_arm_ext")
}

BEGIN { doc["IEEE_FLOAT"] = "\
The macro IEEE_FLOAT is no longer needed.";
    level["IEEE_FLOAT"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])IEEE_FLOAT([^_[:alnum:]]|$)/ {
    fail("IEEE_FLOAT")
}

BEGIN { doc["FLOAT_INFO"] = "\
The macro FLOAT_INFO is deprecated in favour of PRINT_FLOAT_INFO.";
    level["FLOAT_INFO"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])FLOAT_INFO([^_[:alnum:]]|$)/ {
    fail("FLOAT_INFO")
}

BEGIN { doc["INVALID_FLOAT"] = "\
The macro INVALID_FLOAT was just just wierd.";
    level["INVALID_FLOAT"] = '$ARI_REGRESSION'
    bug("INVALID_FLOAT", "gdb/vax-tdep.c", 3);
}
/(^|[^_[:alnum:]])INVALID_FLOAT([^_[:alnum:]]|$)/ {
    fail("INVALID_FLOAT")
}

BEGIN { doc["HOST_BYTE_ORDER"] = "\
The macro HOST_BYTE_ORDER is not used.";
    level["HOST_BYTE_ORDER"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HOST_BYTE_ORDER([^_[:alnum:]]|$)/ {
    fail("HOST_BYTE_ORDER")
}

BEGIN { doc["BIG_ENDIAN"] = "\
The macro BIG_ENDIAN is being replaced with BFD_ENDIAN_BIG.";
    level["BIG_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])BIG_ENDIAN([^_[:alnum:]]|$)/ {
    fail("BIG_ENDIAN")
}

BEGIN { doc["LITTLE_ENDIAN"] = "\
The macro LITTLE_ENDIAN is being replaced with BFD_ENDIAN_LITTLE.";
    level["LITTLE_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])LITTLE_ENDIAN([^_[:alnum:]]|$)/ {
    fail("LITTLE_ENDIAN")
}

BEGIN { doc["report_transfer_performance"] = "\
?????";
    level["report_transfer_performance"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])report_transfer_performance([^_[:alnum:]]|$)/ {
    fail("report_transfer_performance")
}

BEGIN { doc["DECR_PC_AFTER_BREAK"] = "\
I wish this would just go away.";
    level["DECR_PC_AFTER_BREAK"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DECR_PC_AFTER_BREAK([^_[:alnum:]]|$)/ {
    fail("DECR_PC_AFTER_BREAK")
}

BEGIN { doc["USG"] = "\
What does USG even tell us?";
    level["USG"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])USG([^_[:alnum:]]|$)/ {
    fail("USG")
}

BEGIN { doc["EXTRA_FRAME_INFO"] = "\
The macro EXTRA_FRAME_INFO is replaced by struct frame_extra_info.";
    level["EXTRA_FRAME_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])EXTRA_FRAME_INFO([^_[:alnum:]]|$)/ {
    fail("EXTRA_FRAME_INFO")
}

BEGIN { doc["FRAME_FIND_SAVED_REGS"] = "\
The macro FRAME_FIND_SAVED_REGS is replaced by FRAME_INIT_SAVED_REGS.";
    level["FRAME_FIND_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])FRAME_FIND_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("FRAME_FIND_SAVED_REGS")
}

BEGIN { doc["SIZEOF_FRAME_SAVED_REGS"] = "\
The macro SIZEOF_FRAME_SAVED_REGS typically should not be needed.";
    level["SIZEOF_FRAME_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])SIZEOF_FRAME_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("SIZEOF_FRAME_SAVED_REGS")
}

BEGIN { doc["strsignal"] = "\
GDB should be using the ABI to convert a signal into a string?";
    level["strsignal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strsignal[[:blank:]]*\(/ {
    fail("strsignal")
}

BEGIN { doc["target_signal"] = "\
This is really badly named.  It should be called something like gdb_signal \
as it is GDBs internal representation of the target signal.  It gets worse \
as target_signal_to_host() is actually translating to/from the true target \
signal.";
    level["target_signal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])target_signal([^_[:alnum:]]|$)/ {
    fail("target_signal")
}

# The register cache and the addition of a frame argument.

BEGIN { doc["registers []"] = "\
Too many cases of code just blatting registers[].  Use existing interfaces \
and mechanisms.";
    level["registers []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers([^_[:alnum:]]|$)/ && ! /->registers([^_[:alnum:]]|$)/ {
    fail("registers []")
}

BEGIN { doc["register_valid []"] = "\
Too many cases of code just blatting register_valid[].  Use existing \
interfaces and mechanisms.";
    level["register_valid []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_valid([^_[:alnum:]]|$)/ {
    fail("register_valid []")
}

BEGIN { doc["read_register_gen in target"] = "\
Target and nat code should fetch values from the cache using \
regcache_collect()."
    level["read_register_gen in target"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])read_register_gen([^_[:alnum:]]|$)/ && file ~ /.*-nat\.c/ {
    fail("read_register_gen in target")
}

BEGIN { doc["read_register_bytes"] = "\
read_register_bytes() should be avoided, or its semantics fixed.";
    level["read_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])read_register_bytes[[:blank:]]*\(/ {
    fail("read_register_bytes")
}

BEGIN { doc["write_register_bytes"] = "\
write_register_bytes() should be avoided, or its semantics fixed.";
    level["write_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])write_register_bytes[[:blank:]]*\(/ {
    fail("write_register_bytes")
}

BEGIN { doc["registers_fetched"] = "\
registers_fetched() is replaced by supply_register().";
    level["registers_fetched"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers_fetched[[:blank:]]*\(/ {
    fail("registers_fetched")
}

BEGIN { doc["register_buffer"] = "\
register_buffer() is replaced by supply_register().";
    level["register_buffer"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_buffer[[:blank:]]*\(/ {
    fail("register_buffer")
}

BEGIN { doc["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = "\
DEPRECATED_CLEAN_UP_REGISTER_VALUE() is replaced with \
gdbarch_register_write().";
    level["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])DEPRECATED_CLEAN_UP_REGISTER_VALUE([^_[:alnum:]]|$)/ {
    fail("DEPRECATED_CLEAN_UP_REGISTER_VALUE")
}

BEGIN { doc["REGISTER_NAME_ALIAS_HOOK"] = "\
REGISTER_NAME_ALIAS_HOOK() is obsolete.";
    level["REGISTER_NAME_ALIAS_HOOK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ {
    fail("REGISTER_NAME_ALIAS_HOOK")
}

BEGIN { doc["STORE_PSEUDO_REGISTER"] = "\
STORE_PSEUDO_REGISTER() is replaced with gdbarch_register_write().";
    level["STORE_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STORE_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])store_pseudo_register[[:blank:]]*\(/ {
    fail("STORE_PSEUDO_REGISTER")
}

BEGIN { doc["FETCH_PSEUDO_REGISTER"] = "\
FETCH_PSEUDO_REGISTER() is replaced by gdbarch_register_read().";
    level["FETCH_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])FETCH_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])fetch_pseudo_register[[:blank:]]*\(/ {
    fail("FETCH_PSEUDO_REGISTER")
}

BEGIN { doc["IS_TRAPPED_INTERNALVAR"] = "\
IS_TRAPPED_INTERNALVAR() is replaced by gdbarch_register_read().";
    level["IS_TRAPPED_INTERNALVAR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])IS_TRAPPED_INTERNALVAR[[:blank:]]*\(/ {
    fail("IS_TRAPPED_INTERNALVAR")
}

BEGIN { doc["REGISTER_BYTE"] = "\
REGISTER_BYTE can be computed at run time.  Should be local to regcache.c.";
    level["REGISTER_BYTE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTE[[:blank:]]*\(/ {
    fail("REGISTER_BYTE")
}

BEGIN { doc["REGISTER_BYTES"] = "\
REGISTER_BYTES the size of the regcache can be computed at run time.";
    level["REGISTER_BYTES"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTES[[:blank:]]*\(/ {
    fail("REGISTER_BYTES")
}

BEGIN { doc["REGISTER_VIRTUAL_SIZE"] = "\
REGISTER_VIRTUAL_SIZE() can be computed at runtime.";
    level["REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_VIRTUAL_SIZE"] = "\
MAX_REGISTER_VIRTUAL_SIZE() can be computed at run time.";
    level["MAX_REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_RAW_SIZE"] = "\
MAX_REGISTER_RAW_SIZE() can be computed from REGISTER_RAW_SIZE().";
    level["MAX_REGISTER_RAW_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_RAW_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_RAW_SIZE")
}

BEGIN { doc["DO_REGISTERS_INFO"] = "\
DO_REGISTERS_INFO() should be replaced by FRAME_REGISTERS_INFO.";
    level["DO_REGISTERS_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DO_REGISTERS_INFO[[:blank:]]*\(/ {
    fail("DO_REGISTERS_INFO")
}

BEGIN { doc["REGISTER_CONVERTIBLE"] = "\
REGISTER_CONVERTIBLE() has overloaded semantics.";
    level["REGISTER_CONVERTIBLE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERTIBLE[[:blank:]]*\(/ {
    fail("REGISTER_CONVERTIBLE")
}

BEGIN { doc["REGISTER_CONVERT_TO_RAW"] = "\
REGISTER_CONVERT_TO_RAW() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_RAW"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_RAW[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_RAW")
}

BEGIN { doc["REGISTER_CONVERT_TO_VIRTUAL"] = "\
REGISTER_CONVERT_TO_VIRTUAL() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_VIRTUAL"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_VIRTUAL[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_VIRTUAL")
}

# Print functions: Use versions that either check for buffer overflow
# or safely allocate a fresh buffer.

BEGIN { doc["sprintf"] = "\
sprintf() should be avoided.  Use either xasprintf() or snprintf().";
    level["sprintf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sprintf[[:blank:]]*\(/ {
    fail("sprintf")
}

BEGIN { doc["vsprint"] = "\
vsprint() should be avoided.  Use either xvasprint() or vsnprintf().";
    level["vsprint"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vsprint[[:blank:]]*\(/ {
    fail("vsprint")
}

BEGIN { doc["asprintf"] = "\
asprintf() is deprecated in favour of xasprintf().";
    level["asprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])asprintf[[:blank:]]*\(/ {
    fail("asprintf")
}

BEGIN { doc["vasprintf"] = "\
vasprintf() is deprecated in favour of xvasprintf().";
    bug("vasprintf", "gdb/utils.c", 1)
    level["vasprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vasprintf[[:blank:]]*\(/ {
    fail("vasprintf")
}

# Memory allocation: malloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["malloc"] = "\
GDB uses xmalloc() and not malloc()";
    level["malloc"] = '$ARI_REGRESSION';
    bug("malloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])malloc[[:blank:]]*\(/ {
    fail("malloc")
}

BEGIN { doc["calloc"] = "\
GDB uses xcalloc() and not calloc()";
    level["calloc"] = '$ARI_REGRESSION';
    bug("calloc", "gdb/utils.c", 1);
}
/(^|[^_[:alnum:]])calloc[[:blank:]]*\(/ {
    fail("calloc")
}

BEGIN { doc["realloc"] = "\
GDB uses xrealloc() and not realloc()";
    level["realloc"] = '$ARI_REGRESSION';
    bug("realloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])realloc[[:blank:]]*\(/ {
    fail("realloc")
}

BEGIN { doc["free"] = "\
GDB uses xfree() and not free().  xfree() can handle NULL.";
    level["free"] = '$ARI_REGRESSION';
    bug("free", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]>\.])free[[:blank:]]*\(/ {
    fail("free")
}

# Memory allocation: mmalloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["mmalloc"] = "\
GDB uses xmmalloc() and not mmalloc()";
    level["mmalloc"] = '$ARI_REGRESSION'
    bug("mmalloc", "gdb/utils.c", 4);
}
/(^|[^_[:alnum:]])mmalloc[[:blank:]]*\(/ {
    fail("mmalloc")
}

BEGIN { doc["mcalloc"] = "\
GDB uses xmcalloc() and not mcalloc()";
    level["mcalloc"] = '$ARI_REGRESSION'
    bug("mcalloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mcalloc[[:blank:]]*\(/ {
    fail("mcalloc")
}

BEGIN { doc["mrealloc"] = "\
GDB uses xmrealloc() and not mrealloc()";
    level["mrealloc"] = '$ARI_REGRESSION'
    bug("mrealloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mrealloc[[:blank:]]*\(/ {
    fail("mrealloc")
}

BEGIN { doc["mfree"] = "\
GDB uses xmfree() and not mfree()";
    level["mfree"] = '$ARI_REGRESSION'
    bug("mfree", "gdb/utils.c", 3);
}
/(^|[^_[:alnum:]>\.])mfree[[:blank:]]*\(/ {
    fail("mfree")
}

# Memory allocation: xmmalloc(): We are trying to eliminate these
# versions and just use simple xmalloc() and obstacks.

BEGIN { doc["xmmalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmmalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmmalloc[[:blank:]]*\(/ {
    fail("xmmalloc")
}

BEGIN { doc["xmcalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmcalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmcalloc[[:blank:]]*\(/ {
    fail("xmcalloc")
}

BEGIN { doc["xmrealloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmrealloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmrealloc[[:blank:]]*\(/ {
    fail("xmrealloc")
}

BEGIN { doc["xmfree"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmfree"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]>\.])xmfree[[:blank:]]*\(/ {
    fail("xmfree")
}

# More generic memory operations

BEGIN { doc["FREEIF"] = "\
GDB uses xfree() and not FREEIF()";
    level["FREEIF"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])FREEIF[[:blank:]]*\(/ {
    fail("FREEIF")
}

BEGIN { doc["MALLOC_INCOMPATIBLE"] = "\
MALLOC_INCOMPATIBLE should be handled by autoconf.";
    level["MALLOC_INCOMPATIBLE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])MALLOC_INCOMPATIBLE([^_[:alnum:]]|$)/ {
    fail("MALLOC_INCOMPATIBLE")
}

BEGIN { doc["strdup"] = "\
GDB uses xstrdup() and not strdup()";
    level["strdup"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strdup[[:blank:]]*\(/ {
    fail("strdup")
}

BEGIN { doc["strsave"] = "\
strsave() is deprecated in favour of xstrdup() et.al.";
    level["strsave"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strsave[[:blank:]]*\(/ {
    fail("strsave")
}

BEGIN { doc["savestring"] = "\
savestring() needs a rethink.  Should there be a xstrldup() (???).";
    level["savestring"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])savestring[[:blank:]]*\(/ {
    fail("savestring")
}

BEGIN { doc["alloca"] = "\
alloca() is non-portable but its use is tolerated";
    level["alloca"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])alloca[[:blank:]]*\(/ {
    fail("alloca")
}

# String compare functions

BEGIN { doc["STREQ"] = "\
Use ``strcmp() == 0'\'\'' instead of STREQ()."
    level["STREQ"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQ[[:blank:]]*\(/ {
    fail("STREQ")
}

BEGIN { doc["STRCMP"] = "\
Use ``strcmp() == 0'\'\'' instead of STRCMP()"
    level["STRCMP"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])STRCMP[[:blank:]]*\(/ {
    fail("STRCMP")
}

BEGIN { doc["STREQN"] = "\
Use ``strncmp() == 0'\'\'' instead of STREQN()"
    level["STREQN"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQN[[:blank:]]*\(/ {
    fail("STREQN")
}

BEGIN { doc["strncpy"] = "\
Uses strncpy instead of strlcpy (which does not yet exist)";
    level["strncpy"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strncpy[[:blank:]]*\(/ {
    fail("strncpy")
}

BEGIN { doc["!strcmp"] = "\
Use ``strcmp() == 0'\'\'' rather than ``!strcmp()'\'\''.  Correctly \
understanding ``string-compare equals ...'\'\'' is easier than the \
backward logic of ``Not string-compare'\'\''.";
    level["!strcmp"] = '$ARI_INFO'
}
/\![[:blank:]]*str/ {
    fail("!strcmp")
}

BEGIN { doc["strnicmp"] = "\
GDB uses strncasecmp() and not strnicmp()";
    level["strnicmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strnicmp[[:blank:]]*\(/ {
    fail("strnicmp")
}

# Boolean expressions and conditionals

BEGIN { doc["FALSE"] = "\
Definitely do not use FALSE in boolean expressions.";
    level["FALSE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])FALSE([^_[:alnum:]]|$)/ {
    fail("FALSE")
}

BEGIN { doc["TRUE"] = "\
Do not try to use TRUE in boolean expressions.";
    level["TRUE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])TRUE([^_[:alnum:]]|$)/ {
    fail("TRUE")
}

BEGIN { doc["false"] = "\
Definitely do not use ``false'\'\'' in boolean expressions.";
    level["false"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ {
    fail("false")
}

BEGIN { doc["true"] = "\
Do not try to use ``true'\'\'' in boolean expressions.";
    level["true"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ {
    fail("true")
}

BEGIN { doc["if assignment"] = "\
An IF statement'\''s expression includes an assignment.";
    level["if assignment"] = '$ARI_INFO'
}
/ if .* = / {
    fail("if assignment")
}

# Include files for which GDB has a custom version.

BEGIN { doc["assert.h"] = "\
Instead of assert.h, use gdb_assert.h";
    level["assert.h"] = '$ARI_REGRESSION'
    bug("assert.h", "gdb/gdb_assert.h", 0) # it does not use it
}
/^[[:blank:]]*\#[[:blank:]]*include[[:blank:]]+.assert\.h./ {
    fail("assert.h")
}

BEGIN { doc["dirent.h"] = "\
Instead of dirent.h, use gdb_dirent.h";
    level["dirent.h"] = '$ARI_REGRESSION'
    bug("dirent.h", "gdb/gdb_dirent.h", 1);
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.dirent\.h./ {
    fail("dirent.h")
}

BEGIN { doc["proc_service.h"] = "\
Instead of proc_service.h, use gdb_proc_service.h";
    level["proc_service.h"] = '$ARI_WARNING'
    bug("proc_service.h", "gdb/gdb_proc_service.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.proc_service\.h./ {
    fail("proc_service.h")
}

BEGIN { doc["regex.h"] = "\
Instead of regex.h, use gdb_regex.h";
    level["regex.h"] = '$ARI_REGRESSION'
    bug("regex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.regex\.h./ {
    fail("regex.h")
}

BEGIN { doc["xregex.h"] = "\
Instead of xregex.h, use gdb_regex.h";
    level["xregex.h"] = '$ARI_REGRESSION'
    bug("xregex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.xregex\.h./ {
    fail("xregex.h")
}

BEGIN { doc["gnu-regex.h"] = "\
Instead of gnu-regex.h, use gdb_regex.h";
    level["gnu-regex.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.gnu-regex\.h./ {
    fail("gnu regex.h")
}

BEGIN { doc["stat.h"] = "\
Instead of stat.h or sys/stat.h, use gdb_stat.h";
    level["stat.h"] = '$ARI_ERROR'
    bug("stat.h", "gdb/gdb_stat.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.stat\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/stat\.h./ {
    fail("stat.h")
}

BEGIN { doc["string.h"] = "\
Instead of string.h, strings.h or memory.h, use gdb_string.h";
    level["string.h"] = '$ARI_REGRESSION'
    bug("string.h", "gdb/gdb_string.h", 4)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.string\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.strings\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.memory\.h./ {
    fail("string.h")
}

BEGIN { doc["thread_db.h"] = "\
Instead of thread_db.h, use gdb_thread_db.h";
    bug("thread_db.h", "gdb/gdb_thread_db.h", 1);
    level["thread_db.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.thread_db\.h./ {
    fail("thread_db.h")
}

BEGIN { doc["wait.h"] = "\
Instead of wait.h or sys/wait.h, use gdb_wait.h";
    bug("wait.h", "gdb/gdb_wait.h", 2);
    level["wait.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.wait\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/wait\.h./ {
    fail("wait.h")
}

BEGIN { doc["vfork.h"] = "\
Instead of vfork.h, use gdb_vfork.h";
    bug("vfork.h", "gdb/gdb_vfork.h", 1);
    level["vfork.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.vfork\.h./ {
    fail("vfork.h")
}

# Typedefs that are either redundant or can be reduced to ``struct
# type *''.

BEGIN { doc["GDB_FILE"] = "\
GDB_FILE is deprecated in favor of ``struct ui_file'\'\''";
    level["GDB_FILE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])GDB_FILE([^_[:alnum:]]|$)/ {
    fail("GDB_FILE")
}

BEGIN { doc["struct complaint"] = "\
``struct complaint'\'\'' is just nasty and over complex - hashing the \
format string would probably have done the trick";
    level["struct complaint"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])struct complaint([^_[:alnum:]]|$)/ {
    fail("struct complaint")
}

BEGIN { doc["serial_t"] = "\
Change serial_t to ``struct serial'\'\''.";
    level["serial_t"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])serial_t([^_[:alnum:]]|$)/ {
    fail("serial_t")
}

BEGIN { doc["value_ptr"] = "\
Change value_ptr to ``struct value *'\'\''.";
    level["value_ptr"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])value_ptr([^_[:alnum:]]|$)/ {
    fail("value_ptr")
}

BEGIN { doc["tm_print_insn"] = "\
tm_print_insn has been multi-arched.";
    level["tm_print_insn"] = '$ARI_WARNING'
}
/tm_print_insn[[:space:]]*=/ {
    fail("tm_print_insn")
}

BEGIN { doc["goto"] = "\
Please do not use ``goto'\'\''.";
    level["goto"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])goto([^_[:alnum:]]|$)/ {
    fail("goto")
}

BEGIN { doc["label"] = "\
Please do not use labels.";
    level["label"] = '$ARI_INFO'
}
/^[[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*:/ \
    && ! /^[[:space:]]*default[[:space:]]*:/ {
    fail("label")
}

BEGIN { doc["codestream"] = "\
Several targets contain a codestream - aka instruction cache.  More than anything \
is is probably caused by the broken target stack.";
    level["codestream"] = '$ARI_INFO'
}
/codestream/ {
    fail("codestream")
}

BEGIN { doc["wrap_"] = "\
Several targets are using a wrapper function found in wrapper.c. \
Unfortunatly, they are hard to debug and contain a bad cast."
    level["wrap_"] = '$ARI_INFO'
}
/wrap_/ {
    fail("wrap_")
}

BEGIN { doc["var_auto_boolean"] = "\
Use the function add_set_auto_boolean_cmd() instead of var_auto_boolean.";
    bug("var_auto_boolean", "gdb/cli/cli-decode.c", 1)
    bug("var_auto_boolean", "gdb/cli/cli-decode.h", 1)
    bug("var_auto_boolean", "gdb/cli/cli-setshow.c", 2)
    bug("var_auto_boolean", "gdb/command.h", 1)
    level["var_auto_boolean"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])var_auto_boolean([^_[:alnum:]]|$)/ {
    fail("var_auto_boolean")
}

BEGIN { doc["var_boolean"] = "\
Use the function add_set_boolean_cmd() instead of var_boolean.";
    level["var_boolean"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])var_boolean([^_[:alnum:]]|$)/ {
    fail("var_boolean")
}

END {
    # Dump the documentation
    for (bug in doc) {
	if (! (bug in total)) {
	    total[bug] = 0
	}
    }
    for (bug in doc) {
	# ari.*.doc: <BUG>:<COUNT>:<LEVEL>:<DOC>
	print bug ":" total[bug] ":" level[bug] ":" doc[bug] >> "'${wwwdir}'/ari.source.doc"
    }
}' >${wwwdir}/ari.source.bug
Checking for doschk
Checking Makefile.in for non- -Werror rules
Create the ARI table (level 2)
/www/sourceware/htdocs/gdb/ari/new.html:	 90.6%
Create the ARI table (level 4)
/www/sourceware/htdocs/gdb/ari/new-ari.html:	 93.3%
total 396
-rw-rw-r--    1 gdbadmin gdb          4836 Feb  9 19:52 ari.doschk.bug
-rw-rw-r--    1 gdbadmin gdb          1215 Feb  9 19:52 ari.doschk.doc
-rw-rw-r--    1 gdbadmin gdb          4703 Feb  9 19:52 ari.doschk.out
-rw-rw-r--    1 gdbadmin gdb         27025 Feb  9 19:52 ari.doschk.sed
-rw-rw-r--    1 cagney   gdb         87632 Feb  9 19:52 ari.html
-rw-rw-r--    1 cagney   gdb          5887 Feb  9 19:52 ari.html.gz
-rw-rw-r--    1 gdbadmin gdb             0 Feb  9 19:52 ari.source.bug
-rw-rw-r--    1 gdbadmin gdb           508 Feb  9 19:52 ari.werror.bug
-rw-rw-r--    1 gdbadmin gdb            86 Feb  9 19:52 ari.werror.doc
-rw-rw-r--    1 cgf      gdb         21623 Feb  9 19:52 index.html
-rw-rw-r--    1 cagney   gdb          2039 Feb  9 19:52 index.html.gz
-rw-rw-r--    1 gdbadmin gdb         87632 Feb  9 19:52 new-ari.html
-rw-rw-r--    1 gdbadmin gdb          5887 Feb  9 19:52 new-ari.html.gz
-rw-rw-r--    1 gdbadmin gdb         21623 Feb  9 19:52 new.html
-rw-rw-r--    1 gdbadmin gdb          2039 Feb  9 19:52 new.html.gz
-rw-rw-r--    1 cagney   gdb         87632 Feb  9 19:52 old-ari.html
-rw-rw-r--    1 cagney   gdb          5885 Feb  9 19:52 old-ari.html.gz
-rw-rw-r--    1 cagney   gdb         21623 Feb  9 19:52 old.html
-rw-rw-r--    1 cagney   gdb          2039 Feb  9 19:52 old.html.gz

+ sh ./update-web-docs /sourceware/ftp/anonftp/pub/gdb/snapshots/current/gdb+dejagnu.tar.bz2 /sourceware/snapshot-tmp/gdb+dejagnu-web-docs /www/sourceware/htdocs/gdb/onlinedocs gdb
unpack the tar-ball
configure things
Create HTML files
Find all the HTML files in the repository, except those in directories
And copy the resulting html files to the web server
Create PDF documents
gdb.pdf:		 37.6%
gdbint.pdf:		 35.0%
stabs.pdf:		 35.7%
Create POSTSCRIPT documents
gdb.ps:			 69.0%
gdbint.ps:		 66.2%
refcard.ps:		 59.4%
stabs.ps:		 65.5%
create a very basic index.html

+ sh ./update-web-ari /sourceware/ftp/anonftp/pub/gdb/snapshots/current/insight+dejagnu.tar.bz2 /sourceware/snapshot-tmp/insight+dejagnu-web-ari /www/sourceware/htdocs/insight/ari gdb
Unpacking tar ball
Checking source code
awk: cmd. line:20: fatal error: internal error
./update-web-ari: line 1533: 19621 Broken pipe             find "${srcdir}/${project}" -name 'testsuite' -prune -o -name 'stop-gdb.c' -prune -o -name 'stuff.c' -prune -o -name '*-stub.c' -prune -o -name '*-share' -prune -o -name 'tui' -prune -o -name 'nlm' -prune -o -name 'gnu-regex.c' -prune -o -name 'gnu-regex.h' -prune -o -name '*\.tab\.c' -prune -o -name 'gdbserver' -prune -o -name '*.[hc]' -type f -print
     19622 Aborted                 | $AWK '
BEGIN {
    comment_p = 0
    string_p = 0
}

function fail (bug) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    if (fixit[bug, file] > 0) {
	fixit[bug, file] -= 1
    } else {
	print bug ":" 1 ":" level[bug] ":" file ":" FNR
	total[bug] += 1
    }
}

function bug (bug, file, count) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    # print bug ":" -count ":" level[bug] ":" file ":" 0
    fixit[bug, file] = count
}

# Load the list of files into an initially empty argument list.
# While STDIN is being parsed, ARGIND will remain zero.
ARGIND == 0 {
    ARGV[ARGC++] = $0;
    next;
}

# Initialize the PARSER
FNR == 1 {
    file = FILENAME;
    sub (/^.*\/'"${project}"'\//, "", file);
    file = "'"${project}"'/" file
    #printf " %s", file > "/dev/stderr";
    #fflush (/dev/stderr);
}

# Skip deprecated/obsolete lines
/(^|[^_[:alnum:]])DEPRECATED([^_[:alnum:]]|$)/ { next; }
/(^|[^_[:alnum:]])OBSOLETE([^_[:alnum:]]|$)/ { next; }

# Strip out comments
FNR == 1 { comment_p = 0; }
comment_p && /\*\// { gsub (/^([^\*]|\*+[^\/\*])*\*+\//, " "); comment_p = 0; }
comment_p { next; }
!comment_p { gsub (/\/\*([^\*]|\*+[^\/\*])*\*+\//, " "); }
!comment_p && /\/\*/ { gsub (/\/\*.*$/, " "); comment_p = 1; }

BEGIN { doc["error capital"] = "\
The error message should start with a capital but no one is sure of this"
    level["error capital"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^A-Z]*[^\/]"/ {
    fail("error capital")
}

BEGIN { doc["error full-stop"] = "\
The error message should not have a trailing full-stop"
    level["error full-stop"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^"]\."/ {
    fail("error full-stop")
}

# SNIP - Strip out strings - brain dead at present does not handle \" - SNIP

FNR == 1 { string_p = 0; }
string_p && /(^\"|[^\\]\")/ { gsub (/^([^\"]|\\\")*\"/, " "); string_p = 0; }
string_p { next; }
!string_p { gsub (/\"([^\"]|\\\")*\"/, " "); }
!string_p && /\"/ { gsub (/\"([^\"]|\\\")*$/, " "); string_p = 1; }

# Accumulate continuation lines
FNR == 1 { cont_p = 0; }
!cont_p { full_line = ""; }
/[^\\]\\$/ { gsub (/\\$/, ""); full_line = full_line $0; cont_p = 1; next; }
cont_p { $0 = full_line $0; cont_p = 0; full_line = ""; }


# GDB uses ISO C.  Check for any non pure ISO C code

BEGIN { doc["PARAMS"] = "\
Still uses the PARAMS macro.";
    level["PARAMS"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])PARAMS([^_[:alnum:]]|$)/ {
    fail("PARAMS")
}

BEGIN { doc["__STDC__"] = "\
GDB assumes ISO C, testing for __STDC__ makes little sense";
    level["__STDC__"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])__STDC__([^_[:alnum:]]|$)/ {
    fail("__STDC__")
}

BEGIN { doc["__CYGWIN32__"] = "\
__CYGWIN32__ has been replaced by __CYGWIN__ or, better, explicit \
autoconf tests";
    level["__CYGWIN32__"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])__CYGWIN32__([^_[:alnum:]]|$)/ {
    fail("__CYGWIN32__")
}

BEGIN { doc["PTR"] = "\
Use ``void *'\'\''.  PTR dates back to the days before ISO C.";
    level["PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])PTR([^_[:alnum:]]|$)/ {
    fail("PTR")
}

BEGIN { doc["CONST_PTR"] = "\
Use ``const void *'\'\''.  PTR dates back to the days before ISO C.";
    level["CONST_PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])CONST_PTR([^_[:alnum:]]|$)/ {
    fail("CONST_PTR")
}

BEGIN { doc["grep ^func"] = "\
A function declaration with the function name positioned at the very start \
of a line.  Only as part of the function definition should the function \
name appear at the very start of a line.  This is so that \
``grep ^func'\'\'' works";
    level["grep ^func"] = '$ARI_WARNING'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:blank:]]*[^\*].*\);[[:blank:]]*/ {
    # FYI, it matches:
    #NAME (...);
    # when a normal declaration would have:
    #TYPE NAME (...);
    fail("grep ^func")
}

BEGIN { doc["K&R defn"] = "\
Still uses old style K&R function definition (not declaration) \
This check is BUGGY.  It appears to also  match things like a declaration \
where the function name is at the start of a line."
    level["K&R defn"] = '$ARI_ERROR'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:alnum:]_]*[[:blank:]]*[,\)]/ && ! /\(void\)/ && ! /\);/ {
    fail("K&R defn")
}

BEGIN { doc["make_cleanup_func"] = "\
Type casting using make_cleanup_func is invalid ISO C";
    level["make_cleanup_func"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])make_cleanup_func([^_[:alnum:]]|$)/ {
    fail("make_cleanup_func")
}

BEGIN { doc["catch_errors_ftype"] = "\
Type casting using catch_errors_ftype is invalid ISO C";
    level["catch_errors_ftype"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors_ftype([^_[:alnum:]]|$)/ {
    fail("catch_errors_ftype")
}

BEGIN { doc["catch_errors"] = "\
Use catch_exceptions() in preference to catch_errors().";
    level["catch_errors"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors[[:space:]]*\(/ {
    fail("catch_errors")
}

BEGIN { doc["strerror"] = "\
Use safe_strerror() in preference to strerror().";
    level["strerror"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])strerror[[:space:]]*\(/ {
    fail("strerror")
}

BEGIN { doc["long long"] = "\
Change ``long long'\'\'' to ``LONGEST'\'\''.";
    level["long long"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])long[[:space:]]+long([^_[:alnum:]]|$)/ {
    fail("long long")
}

BEGIN { doc["ATTRIBUTE_UNUSED"] = "\
GDB is compiled with -Werror and, consequently, is not able to tolerate \
false warnings.  Since -Wunused-param produces such warnings, neither \
that warning flag nor ATTRIBUTE_UNUSED are used in GDB."
    level["ATTRIBUTE_UNUSED"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])ATTRIBUTE_UNUSED([^_[:alnum:]]|$)/ {
    fail("ATTRIBUTE_UNUSED")
}

# General problems

BEGIN { doc["_func"] = "\
The suffixes ..._func and ..._ftype are used inconsistently in the source. \
Perhaps just ..._ftype should be used.";
    level["_func"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])[[:alpha:]_][[:alnum:]_]*_func([^_[:alnum:]]|$)/ {
    fail("_func")
}

BEGIN { doc["TARGET_BYTE_ORDER_SELECTABLE"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_SELECTABLE"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_SELECTABLE/ {
    fail("TARGET_BYTE_ORDER_SELECTABLE")
}

BEGIN { doc["TARGET_BYTE_ORDER_DEFAULT"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_DEFAULT"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_DEFAULT/ {
    fail("TARGET_BYTE_ORDER_DEFAULT")
}

# Correct use of initialized?
BEGIN {
    doc["_initialize decl"] = "\
Declaration of _initialize*() missing.  The declaration stops a -Wmissing-declarations \
warning from GCC.";
    level["_initialize decl"] = '$ARI_INFO'
    doc["_initialize ftype"] = "\
Declaration of _initialize*() does not use initialize_file_ftype, should it?";
    level["_initialize ftype"] = '$ARI_INFO'
}
# Remember what type declaration, if any, we see
FNR == 1 {
    initialize_decl = 0;
    initialize_ftype = 0;
}
/^extern[[:space:]]+void[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_decl = 1
}
/^extern[[:space:]]+initialize_file_ftype[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_ftype = 1
}
# Check it against the definition
/^_initialize_[_[:alnum:]]*[[:space:]]+/ {
    if (!initialize_decl && !initialize_ftype) {
	fail("_initialize decl")
    }
    if (!initialize_ftype) {
	fail("_initialize ftype")
    }
}

# FIXME: Since strings are stripped, does this still work?
BEGIN { doc["error internal error"] = "\
Code should call the internal_error() function rather than print an \
internal-error message directly";
    level["error internal error"] = '$ARI_REGRESSION'
}
/error.*\"Internal error/ || /error.*\"internal error/ {
    fail("error internal error")
}

BEGIN { doc["inline"] = "\
Let the compiler decide if something needs to be made inline"
    level["inline"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {
    fail("inline")
}

BEGIN { doc["register"] = "\
Let the compiler decide if something needs to be made register"
    level["register"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])register([^_[:alnum:]]|$)/ {
    fail("register")
}

BEGIN { doc["return_to_top_level"] = "\
return_to_top_level() is deprecated in favor of the verror(), error_stream() \
et.al.";
    level["return_to_top_level"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])return_to_top_level[[:blank:]]*\(/ {
    fail("return_to_top_level")
}

BEGIN { doc["error_begin"] = "\
error_begin() is deprecated in favor of verror(), error_stream() et.al.";
    level["error_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])error_begin[[:blank:]]*\(/ {
    fail("error_begin")
}

BEGIN { doc["warning_begin"] = "\
warning_begin() is deprecated in favor of vwarning(), warning_stream() \
et.al. (see error_begin())";
    level["warning_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])warning_begin[[:blank:]]*\(/ {
    fail("warning_begin")
}

BEGIN { doc["sizeof (CORE_ADDR)"] = "\
CORE_ADDR is not the same size as the host/target address.  Use TARGET_PTR_BIT \
or TARGET_ADDR_BIT.";
    level["sizeof (CORE_ADDR)"] = '$ARI_WARNING'
}
/sizeof[[:blank:]]*(CORE_ADDR)/ {
    fail("sizeof (CORE_ADDR)")
}

BEGIN { doc["REGNO"] = "\
Use the ..._REGNUM instead of the ..._REGNO name suffix";
    level["REGNO"] = '$ARI_WARNING'
}
/_REGNO([^_[:alnum:]]|$)/ || /_regno([^_[:alnum:]]|$)/ {
    fail("REGNO")
}

BEGIN { doc["abort"] = "\
GDB should never abort - use internal_error()";
    level["abort"] = '$ARI_REGRESSION'
    bug("abort", "gdb/utils.c", 3)
}
/(^|[^_[:alnum:]])abort[[:blank:]]*\(/ {
    fail("abort")
}

BEGIN { doc["basename"] = "\
GDB should never basename - use ``const char *lbasename(const char *)'\'\''";
    level["basename"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])basename[[:blank:]]*\(/ {
    fail("basename")
}

BEGIN { doc["assert"] = "\
GDB should never use assert().  Assert() calls abort() and GDB should \
not abort.  Use internal_error() or gdb_assert() instead.";
    level["assert"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])assert[[:blank:]]*\(/ {
    fail("assert")
}

BEGIN { doc["sizeof CORE_ADDR"] = "\
Taking the sizeof a CORE_ADDR is potentially dangerous.  CORE_ADDR is at \
least as big as the target pointer, _not_ the same size."
    level["sizeof CORE_ADDR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sizeof[:blank:]*\(CORE_ADDR\)/ {
    fail("sizeof CORE_ADDR")
}

BEGIN { doc["CORE_ADDR cast"] = "\
Casting something to a CORE_ADDR is typically dangerous and non-portable. \
(The data from this pattern may be wrong)";
    level["CORE_ADDR cast"] = '$ARI_WARNING'
}
/\(CORE_ADDR\)[:blank:]*[^,);]/ {
    fail("CORE_ADDR cast")
}

BEGIN { doc["QUIT"] = "\
Uses QUIT which could be unsafe. Should it instead use ``if (QUIT_P ()) \
return ...;'\'\'' (which does not yet exist)."
    level["QUIT"] = '$ARI_INFO'
}
/QUIT[[:blank:]]*[^;]/ {
    fail("QUIT")
}

BEGIN { doc["quit_flag"] = "\
Uses ``quit_flag'\'\''.  Should it instead use ``if (QUIT_P ()) ...'\'\'' \
(which does not yet exist).";
    level["quit_flag"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])quit_flag([^_[:alnum:]]|$)/ {
    fail("quit_flag")
}

BEGIN { doc["extern"] = "\
An ``extern'\'\'' declaration appears in a .c file";
    level["extern"] = '$ARI_WARNING'
    bug("extern", "gdb/ser-go32.c", 1) # extern *environ;
}
/^[[:blank:]]*extern[[:blank:]]*/ && ! /_initialize_/ && file ~ /\.c$/ { 
    fail("extern")
}

BEGIN { doc["#define"] = "\
Delcare an enum in preference to define a macro. ???";
    level["#define"] = '$ARI_INFO'
}
/^[[:blank:]]*#define[[:blank:]]+[[:alnum:]_]+[[:blank:]]+/ {
    fail("#define")
}

BEGIN { doc["#if"] = "\
Use an if statement in preference to conditionally compiled code. ???";
    level["#if"] = '$ARI_INFO'
}
/^[[:blank:]]*#if/ && ! / HAVE_/ {
    fail("#if")
}

BEGIN { doc["GDBTK"] = "\
#ifdef GDBTK should not be needed.";
    level["GDBTK"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])GDBTK([^_[:alnum:]]|$)/ {
    fail("GDBTK")
}

BEGIN { doc["TUI"] = "\
#ifdef TUI should not be needed.";
    level["TUI"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])TUI([^_[:alnum:]]|$)/ {
    fail("TUI")
}

BEGIN { doc["HAVE_VFORK"] = "\
#ifdef HAVE_VFORK is redundant.  Include \"gdb_vfork.h\" and call vfork() \
unconditionally.";
    level["HAVE_VFORK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HAVE_VFORK([^_[:alnum:]]|$)/ {
    fail("HAVE_VFORK")
}

BEGIN { doc["DEBUG"] = "\
Nothing should depend on a macro like DEBUG"
    level["DEBUG"] = '$ARI_INFO'
}
/^#if.*DEBUG/ {
    fail("DEBUG")
}

BEGIN { doc["union"] = "\
The union construct always leads to problems...";
    level["union"] = '$ARI_INFO'
}
/[[:blank:]]*union[[:blank:]]*/ {
    fail("union")
}

BEGIN { doc["unsafe getpkt"] = "\
Function that can call longjmp.";
    level["unsafe getpkt"] = '$ARI_INFO'
}
/^[^_[:alnum:]]getpkt([^_[:alnum:]]|$)/ {
    fail("unsafe getpkt")
}

BEGIN { doc["unsafe error"] = "\
Function that can can call longjmp.";
    level["unsafe error"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])error[[:blank:]]*\(/ {
    fail("unsafe error")
}

BEGIN { doc["readchar"] = "\
Parameterise the remote serial read/write code with the serial device \
being read.";
    level["readchar"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])readchar[[:blank:]]*\(/ {
    fail("readchar")
}

BEGIN { doc["sigsetmask"] = "\
sigsetmask() is deprecated in favour of sigprocmask().";
    level["sigsetmask"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sigsetmask[[:blank:]]*\(/ {
    fail("sigsetmask")
}

BEGIN { doc["bcmp"] = "\
bcmp() is deprecated in favor of the ISO C function memcmp().";
    level["bcmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])bcmp[[:blank:]]*\(/ {
    fail("bcmp")
}

BEGIN { doc["bzero"] = "\
bzero() id deprecated in favour of the ISO C function memset().";
    level["bzero"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bzero[[:blank:]]*\(/ {
    fail("bzero")
}

BEGIN { doc["bcopy"] = "\
bcopy() id deprecated in favour of the ISO C functions memcpy() and \
memmove().";
    level["bcopy"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bcopy[[:blank:]]*\(/ {
    fail("bcopy")
}

BEGIN { doc["atoi"] = "\
Use strtol() instead of atoi().  The latter has a habit of accepting dud \
strings.";
    level["atoi"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])atoi[[:blank:]]*\(/ {
    fail("atoi")
}

BEGIN { doc["printf"] = "\
All GDB output should use the *printf*filtered() functions.";
    level["printf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])printf[[:blank:]]*\(/ {
    fail("printf")
}

BEGIN { doc["%p"] = "\
Use %s and paddr() to print target addresses, not %p.";
    level["%p"] = '$ARI_REGRESSION'
}
/%p/ {
    fail("%p")
}

BEGIN { doc["extract_floating"] = "\
GDB should use extract_typed_floating().";
    level["extract_floating"] = '$ARI_WARNING'
    bug("extract_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])extract_floating[[:blank:]]*\(/ {
    fail("extract_floating")
}

BEGIN { doc["store_floating"] = "\
GDB should use store_typed_floating().";
    level["store_floating"] = '$ARI_WARNING'
    bug("store_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])store_floating[[:blank:]]*\(/ {
    fail("store_floating")
}

BEGIN { doc["floatformat_to_double"] = "\
GDB should use floatformat_to_doublest().";
    level["floatformat_to_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_to_double[[:blank:]]*\(/ {
    fail("floatformat_to_double")
}

BEGIN { doc["floatformat_from_double"] = "\
GDB should use floatformat_from_doublest().";
    level["floatformat_from_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_from_double[[:blank:]]*\(/ {
    fail("floatformat_from_double")
}

BEGIN { doc["floatformat_arm_ext"] = "\
GDB should use floatformat_arm_big or floatformat_arm_littlebyte_bigword.";
    level["floatformat_arm_ext"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])floatformat_arm_ext([^_[:alnum:]]|$)/ {
    fail("floatformat_arm_ext")
}

BEGIN { doc["IEEE_FLOAT"] = "\
The macro IEEE_FLOAT is no longer needed.";
    level["IEEE_FLOAT"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])IEEE_FLOAT([^_[:alnum:]]|$)/ {
    fail("IEEE_FLOAT")
}

BEGIN { doc["FLOAT_INFO"] = "\
The macro FLOAT_INFO is deprecated in favour of PRINT_FLOAT_INFO.";
    level["FLOAT_INFO"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])FLOAT_INFO([^_[:alnum:]]|$)/ {
    fail("FLOAT_INFO")
}

BEGIN { doc["INVALID_FLOAT"] = "\
The macro INVALID_FLOAT was just just wierd.";
    level["INVALID_FLOAT"] = '$ARI_REGRESSION'
    bug("INVALID_FLOAT", "gdb/vax-tdep.c", 3);
}
/(^|[^_[:alnum:]])INVALID_FLOAT([^_[:alnum:]]|$)/ {
    fail("INVALID_FLOAT")
}

BEGIN { doc["HOST_BYTE_ORDER"] = "\
The macro HOST_BYTE_ORDER is not used.";
    level["HOST_BYTE_ORDER"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HOST_BYTE_ORDER([^_[:alnum:]]|$)/ {
    fail("HOST_BYTE_ORDER")
}

BEGIN { doc["BIG_ENDIAN"] = "\
The macro BIG_ENDIAN is being replaced with BFD_ENDIAN_BIG.";
    level["BIG_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])BIG_ENDIAN([^_[:alnum:]]|$)/ {
    fail("BIG_ENDIAN")
}

BEGIN { doc["LITTLE_ENDIAN"] = "\
The macro LITTLE_ENDIAN is being replaced with BFD_ENDIAN_LITTLE.";
    level["LITTLE_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])LITTLE_ENDIAN([^_[:alnum:]]|$)/ {
    fail("LITTLE_ENDIAN")
}

BEGIN { doc["report_transfer_performance"] = "\
?????";
    level["report_transfer_performance"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])report_transfer_performance([^_[:alnum:]]|$)/ {
    fail("report_transfer_performance")
}

BEGIN { doc["DECR_PC_AFTER_BREAK"] = "\
I wish this would just go away.";
    level["DECR_PC_AFTER_BREAK"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DECR_PC_AFTER_BREAK([^_[:alnum:]]|$)/ {
    fail("DECR_PC_AFTER_BREAK")
}

BEGIN { doc["USG"] = "\
What does USG even tell us?";
    level["USG"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])USG([^_[:alnum:]]|$)/ {
    fail("USG")
}

BEGIN { doc["EXTRA_FRAME_INFO"] = "\
The macro EXTRA_FRAME_INFO is replaced by struct frame_extra_info.";
    level["EXTRA_FRAME_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])EXTRA_FRAME_INFO([^_[:alnum:]]|$)/ {
    fail("EXTRA_FRAME_INFO")
}

BEGIN { doc["FRAME_FIND_SAVED_REGS"] = "\
The macro FRAME_FIND_SAVED_REGS is replaced by FRAME_INIT_SAVED_REGS.";
    level["FRAME_FIND_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])FRAME_FIND_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("FRAME_FIND_SAVED_REGS")
}

BEGIN { doc["SIZEOF_FRAME_SAVED_REGS"] = "\
The macro SIZEOF_FRAME_SAVED_REGS typically should not be needed.";
    level["SIZEOF_FRAME_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])SIZEOF_FRAME_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("SIZEOF_FRAME_SAVED_REGS")
}

BEGIN { doc["strsignal"] = "\
GDB should be using the ABI to convert a signal into a string?";
    level["strsignal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strsignal[[:blank:]]*\(/ {
    fail("strsignal")
}

BEGIN { doc["target_signal"] = "\
This is really badly named.  It should be called something like gdb_signal \
as it is GDBs internal representation of the target signal.  It gets worse \
as target_signal_to_host() is actually translating to/from the true target \
signal.";
    level["target_signal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])target_signal([^_[:alnum:]]|$)/ {
    fail("target_signal")
}

# The register cache and the addition of a frame argument.

BEGIN { doc["registers []"] = "\
Too many cases of code just blatting registers[].  Use existing interfaces \
and mechanisms.";
    level["registers []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers([^_[:alnum:]]|$)/ && ! /->registers([^_[:alnum:]]|$)/ {
    fail("registers []")
}

BEGIN { doc["register_valid []"] = "\
Too many cases of code just blatting register_valid[].  Use existing \
interfaces and mechanisms.";
    level["register_valid []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_valid([^_[:alnum:]]|$)/ {
    fail("register_valid []")
}

BEGIN { doc["read_register_gen in target"] = "\
Target and nat code should fetch values from the cache using \
regcache_collect()."
    level["read_register_gen in target"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])read_register_gen([^_[:alnum:]]|$)/ && file ~ /.*-nat\.c/ {
    fail("read_register_gen in target")
}

BEGIN { doc["read_register_bytes"] = "\
read_register_bytes() should be avoided, or its semantics fixed.";
    level["read_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])read_register_bytes[[:blank:]]*\(/ {
    fail("read_register_bytes")
}

BEGIN { doc["write_register_bytes"] = "\
write_register_bytes() should be avoided, or its semantics fixed.";
    level["write_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])write_register_bytes[[:blank:]]*\(/ {
    fail("write_register_bytes")
}

BEGIN { doc["registers_fetched"] = "\
registers_fetched() is replaced by supply_register().";
    level["registers_fetched"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers_fetched[[:blank:]]*\(/ {
    fail("registers_fetched")
}

BEGIN { doc["register_buffer"] = "\
register_buffer() is replaced by supply_register().";
    level["register_buffer"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_buffer[[:blank:]]*\(/ {
    fail("register_buffer")
}

BEGIN { doc["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = "\
DEPRECATED_CLEAN_UP_REGISTER_VALUE() is replaced with \
gdbarch_register_write().";
    level["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])DEPRECATED_CLEAN_UP_REGISTER_VALUE([^_[:alnum:]]|$)/ {
    fail("DEPRECATED_CLEAN_UP_REGISTER_VALUE")
}

BEGIN { doc["REGISTER_NAME_ALIAS_HOOK"] = "\
REGISTER_NAME_ALIAS_HOOK() is obsolete.";
    level["REGISTER_NAME_ALIAS_HOOK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ {
    fail("REGISTER_NAME_ALIAS_HOOK")
}

BEGIN { doc["STORE_PSEUDO_REGISTER"] = "\
STORE_PSEUDO_REGISTER() is replaced with gdbarch_register_write().";
    level["STORE_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STORE_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])store_pseudo_register[[:blank:]]*\(/ {
    fail("STORE_PSEUDO_REGISTER")
}

BEGIN { doc["FETCH_PSEUDO_REGISTER"] = "\
FETCH_PSEUDO_REGISTER() is replaced by gdbarch_register_read().";
    level["FETCH_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])FETCH_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])fetch_pseudo_register[[:blank:]]*\(/ {
    fail("FETCH_PSEUDO_REGISTER")
}

BEGIN { doc["IS_TRAPPED_INTERNALVAR"] = "\
IS_TRAPPED_INTERNALVAR() is replaced by gdbarch_register_read().";
    level["IS_TRAPPED_INTERNALVAR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])IS_TRAPPED_INTERNALVAR[[:blank:]]*\(/ {
    fail("IS_TRAPPED_INTERNALVAR")
}

BEGIN { doc["REGISTER_BYTE"] = "\
REGISTER_BYTE can be computed at run time.  Should be local to regcache.c.";
    level["REGISTER_BYTE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTE[[:blank:]]*\(/ {
    fail("REGISTER_BYTE")
}

BEGIN { doc["REGISTER_BYTES"] = "\
REGISTER_BYTES the size of the regcache can be computed at run time.";
    level["REGISTER_BYTES"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTES[[:blank:]]*\(/ {
    fail("REGISTER_BYTES")
}

BEGIN { doc["REGISTER_VIRTUAL_SIZE"] = "\
REGISTER_VIRTUAL_SIZE() can be computed at runtime.";
    level["REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_VIRTUAL_SIZE"] = "\
MAX_REGISTER_VIRTUAL_SIZE() can be computed at run time.";
    level["MAX_REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_RAW_SIZE"] = "\
MAX_REGISTER_RAW_SIZE() can be computed from REGISTER_RAW_SIZE().";
    level["MAX_REGISTER_RAW_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_RAW_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_RAW_SIZE")
}

BEGIN { doc["DO_REGISTERS_INFO"] = "\
DO_REGISTERS_INFO() should be replaced by FRAME_REGISTERS_INFO.";
    level["DO_REGISTERS_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DO_REGISTERS_INFO[[:blank:]]*\(/ {
    fail("DO_REGISTERS_INFO")
}

BEGIN { doc["REGISTER_CONVERTIBLE"] = "\
REGISTER_CONVERTIBLE() has overloaded semantics.";
    level["REGISTER_CONVERTIBLE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERTIBLE[[:blank:]]*\(/ {
    fail("REGISTER_CONVERTIBLE")
}

BEGIN { doc["REGISTER_CONVERT_TO_RAW"] = "\
REGISTER_CONVERT_TO_RAW() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_RAW"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_RAW[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_RAW")
}

BEGIN { doc["REGISTER_CONVERT_TO_VIRTUAL"] = "\
REGISTER_CONVERT_TO_VIRTUAL() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_VIRTUAL"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_VIRTUAL[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_VIRTUAL")
}

# Print functions: Use versions that either check for buffer overflow
# or safely allocate a fresh buffer.

BEGIN { doc["sprintf"] = "\
sprintf() should be avoided.  Use either xasprintf() or snprintf().";
    level["sprintf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sprintf[[:blank:]]*\(/ {
    fail("sprintf")
}

BEGIN { doc["vsprint"] = "\
vsprint() should be avoided.  Use either xvasprint() or vsnprintf().";
    level["vsprint"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vsprint[[:blank:]]*\(/ {
    fail("vsprint")
}

BEGIN { doc["asprintf"] = "\
asprintf() is deprecated in favour of xasprintf().";
    level["asprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])asprintf[[:blank:]]*\(/ {
    fail("asprintf")
}

BEGIN { doc["vasprintf"] = "\
vasprintf() is deprecated in favour of xvasprintf().";
    bug("vasprintf", "gdb/utils.c", 1)
    level["vasprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vasprintf[[:blank:]]*\(/ {
    fail("vasprintf")
}

# Memory allocation: malloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["malloc"] = "\
GDB uses xmalloc() and not malloc()";
    level["malloc"] = '$ARI_REGRESSION';
    bug("malloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])malloc[[:blank:]]*\(/ {
    fail("malloc")
}

BEGIN { doc["calloc"] = "\
GDB uses xcalloc() and not calloc()";
    level["calloc"] = '$ARI_REGRESSION';
    bug("calloc", "gdb/utils.c", 1);
}
/(^|[^_[:alnum:]])calloc[[:blank:]]*\(/ {
    fail("calloc")
}

BEGIN { doc["realloc"] = "\
GDB uses xrealloc() and not realloc()";
    level["realloc"] = '$ARI_REGRESSION';
    bug("realloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])realloc[[:blank:]]*\(/ {
    fail("realloc")
}

BEGIN { doc["free"] = "\
GDB uses xfree() and not free().  xfree() can handle NULL.";
    level["free"] = '$ARI_REGRESSION';
    bug("free", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]>\.])free[[:blank:]]*\(/ {
    fail("free")
}

# Memory allocation: mmalloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["mmalloc"] = "\
GDB uses xmmalloc() and not mmalloc()";
    level["mmalloc"] = '$ARI_REGRESSION'
    bug("mmalloc", "gdb/utils.c", 4);
}
/(^|[^_[:alnum:]])mmalloc[[:blank:]]*\(/ {
    fail("mmalloc")
}

BEGIN { doc["mcalloc"] = "\
GDB uses xmcalloc() and not mcalloc()";
    level["mcalloc"] = '$ARI_REGRESSION'
    bug("mcalloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mcalloc[[:blank:]]*\(/ {
    fail("mcalloc")
}

BEGIN { doc["mrealloc"] = "\
GDB uses xmrealloc() and not mrealloc()";
    level["mrealloc"] = '$ARI_REGRESSION'
    bug("mrealloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mrealloc[[:blank:]]*\(/ {
    fail("mrealloc")
}

BEGIN { doc["mfree"] = "\
GDB uses xmfree() and not mfree()";
    level["mfree"] = '$ARI_REGRESSION'
    bug("mfree", "gdb/utils.c", 3);
}
/(^|[^_[:alnum:]>\.])mfree[[:blank:]]*\(/ {
    fail("mfree")
}

# Memory allocation: xmmalloc(): We are trying to eliminate these
# versions and just use simple xmalloc() and obstacks.

BEGIN { doc["xmmalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmmalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmmalloc[[:blank:]]*\(/ {
    fail("xmmalloc")
}

BEGIN { doc["xmcalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmcalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmcalloc[[:blank:]]*\(/ {
    fail("xmcalloc")
}

BEGIN { doc["xmrealloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmrealloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmrealloc[[:blank:]]*\(/ {
    fail("xmrealloc")
}

BEGIN { doc["xmfree"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmfree"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]>\.])xmfree[[:blank:]]*\(/ {
    fail("xmfree")
}

# More generic memory operations

BEGIN { doc["FREEIF"] = "\
GDB uses xfree() and not FREEIF()";
    level["FREEIF"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])FREEIF[[:blank:]]*\(/ {
    fail("FREEIF")
}

BEGIN { doc["MALLOC_INCOMPATIBLE"] = "\
MALLOC_INCOMPATIBLE should be handled by autoconf.";
    level["MALLOC_INCOMPATIBLE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])MALLOC_INCOMPATIBLE([^_[:alnum:]]|$)/ {
    fail("MALLOC_INCOMPATIBLE")
}

BEGIN { doc["strdup"] = "\
GDB uses xstrdup() and not strdup()";
    level["strdup"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strdup[[:blank:]]*\(/ {
    fail("strdup")
}

BEGIN { doc["strsave"] = "\
strsave() is deprecated in favour of xstrdup() et.al.";
    level["strsave"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strsave[[:blank:]]*\(/ {
    fail("strsave")
}

BEGIN { doc["savestring"] = "\
savestring() needs a rethink.  Should there be a xstrldup() (???).";
    level["savestring"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])savestring[[:blank:]]*\(/ {
    fail("savestring")
}

BEGIN { doc["alloca"] = "\
alloca() is non-portable but its use is tolerated";
    level["alloca"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])alloca[[:blank:]]*\(/ {
    fail("alloca")
}

# String compare functions

BEGIN { doc["STREQ"] = "\
Use ``strcmp() == 0'\'\'' instead of STREQ()."
    level["STREQ"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQ[[:blank:]]*\(/ {
    fail("STREQ")
}

BEGIN { doc["STRCMP"] = "\
Use ``strcmp() == 0'\'\'' instead of STRCMP()"
    level["STRCMP"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])STRCMP[[:blank:]]*\(/ {
    fail("STRCMP")
}

BEGIN { doc["STREQN"] = "\
Use ``strncmp() == 0'\'\'' instead of STREQN()"
    level["STREQN"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQN[[:blank:]]*\(/ {
    fail("STREQN")
}

BEGIN { doc["strncpy"] = "\
Uses strncpy instead of strlcpy (which does not yet exist)";
    level["strncpy"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strncpy[[:blank:]]*\(/ {
    fail("strncpy")
}

BEGIN { doc["!strcmp"] = "\
Use ``strcmp() == 0'\'\'' rather than ``!strcmp()'\'\''.  Correctly \
understanding ``string-compare equals ...'\'\'' is easier than the \
backward logic of ``Not string-compare'\'\''.";
    level["!strcmp"] = '$ARI_INFO'
}
/\![[:blank:]]*str/ {
    fail("!strcmp")
}

BEGIN { doc["strnicmp"] = "\
GDB uses strncasecmp() and not strnicmp()";
    level["strnicmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strnicmp[[:blank:]]*\(/ {
    fail("strnicmp")
}

# Boolean expressions and conditionals

BEGIN { doc["FALSE"] = "\
Definitely do not use FALSE in boolean expressions.";
    level["FALSE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])FALSE([^_[:alnum:]]|$)/ {
    fail("FALSE")
}

BEGIN { doc["TRUE"] = "\
Do not try to use TRUE in boolean expressions.";
    level["TRUE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])TRUE([^_[:alnum:]]|$)/ {
    fail("TRUE")
}

BEGIN { doc["false"] = "\
Definitely do not use ``false'\'\'' in boolean expressions.";
    level["false"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ {
    fail("false")
}

BEGIN { doc["true"] = "\
Do not try to use ``true'\'\'' in boolean expressions.";
    level["true"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ {
    fail("true")
}

BEGIN { doc["if assignment"] = "\
An IF statement'\''s expression includes an assignment.";
    level["if assignment"] = '$ARI_INFO'
}
/ if .* = / {
    fail("if assignment")
}

# Include files for which GDB has a custom version.

BEGIN { doc["assert.h"] = "\
Instead of assert.h, use gdb_assert.h";
    level["assert.h"] = '$ARI_REGRESSION'
    bug("assert.h", "gdb/gdb_assert.h", 0) # it does not use it
}
/^[[:blank:]]*\#[[:blank:]]*include[[:blank:]]+.assert\.h./ {
    fail("assert.h")
}

BEGIN { doc["dirent.h"] = "\
Instead of dirent.h, use gdb_dirent.h";
    level["dirent.h"] = '$ARI_REGRESSION'
    bug("dirent.h", "gdb/gdb_dirent.h", 1);
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.dirent\.h./ {
    fail("dirent.h")
}

BEGIN { doc["proc_service.h"] = "\
Instead of proc_service.h, use gdb_proc_service.h";
    level["proc_service.h"] = '$ARI_WARNING'
    bug("proc_service.h", "gdb/gdb_proc_service.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.proc_service\.h./ {
    fail("proc_service.h")
}

BEGIN { doc["regex.h"] = "\
Instead of regex.h, use gdb_regex.h";
    level["regex.h"] = '$ARI_REGRESSION'
    bug("regex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.regex\.h./ {
    fail("regex.h")
}

BEGIN { doc["xregex.h"] = "\
Instead of xregex.h, use gdb_regex.h";
    level["xregex.h"] = '$ARI_REGRESSION'
    bug("xregex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.xregex\.h./ {
    fail("xregex.h")
}

BEGIN { doc["gnu-regex.h"] = "\
Instead of gnu-regex.h, use gdb_regex.h";
    level["gnu-regex.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.gnu-regex\.h./ {
    fail("gnu regex.h")
}

BEGIN { doc["stat.h"] = "\
Instead of stat.h or sys/stat.h, use gdb_stat.h";
    level["stat.h"] = '$ARI_ERROR'
    bug("stat.h", "gdb/gdb_stat.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.stat\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/stat\.h./ {
    fail("stat.h")
}

BEGIN { doc["string.h"] = "\
Instead of string.h, strings.h or memory.h, use gdb_string.h";
    level["string.h"] = '$ARI_REGRESSION'
    bug("string.h", "gdb/gdb_string.h", 4)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.string\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.strings\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.memory\.h./ {
    fail("string.h")
}

BEGIN { doc["thread_db.h"] = "\
Instead of thread_db.h, use gdb_thread_db.h";
    bug("thread_db.h", "gdb/gdb_thread_db.h", 1);
    level["thread_db.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.thread_db\.h./ {
    fail("thread_db.h")
}

BEGIN { doc["wait.h"] = "\
Instead of wait.h or sys/wait.h, use gdb_wait.h";
    bug("wait.h", "gdb/gdb_wait.h", 2);
    level["wait.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.wait\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/wait\.h./ {
    fail("wait.h")
}

BEGIN { doc["vfork.h"] = "\
Instead of vfork.h, use gdb_vfork.h";
    bug("vfork.h", "gdb/gdb_vfork.h", 1);
    level["vfork.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.vfork\.h./ {
    fail("vfork.h")
}

# Typedefs that are either redundant or can be reduced to ``struct
# type *''.

BEGIN { doc["GDB_FILE"] = "\
GDB_FILE is deprecated in favor of ``struct ui_file'\'\''";
    level["GDB_FILE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])GDB_FILE([^_[:alnum:]]|$)/ {
    fail("GDB_FILE")
}

BEGIN { doc["struct complaint"] = "\
``struct complaint'\'\'' is just nasty and over complex - hashing the \
format string would probably have done the trick";
    level["struct complaint"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])struct complaint([^_[:alnum:]]|$)/ {
    fail("struct complaint")
}

BEGIN { doc["serial_t"] = "\
Change serial_t to ``struct serial'\'\''.";
    level["serial_t"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])serial_t([^_[:alnum:]]|$)/ {
    fail("serial_t")
}

BEGIN { doc["value_ptr"] = "\
Change value_ptr to ``struct value *'\'\''.";
    level["value_ptr"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])value_ptr([^_[:alnum:]]|$)/ {
    fail("value_ptr")
}

BEGIN { doc["tm_print_insn"] = "\
tm_print_insn has been multi-arched.";
    level["tm_print_insn"] = '$ARI_WARNING'
}
/tm_print_insn[[:space:]]*=/ {
    fail("tm_print_insn")
}

BEGIN { doc["goto"] = "\
Please do not use ``goto'\'\''.";
    level["goto"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])goto([^_[:alnum:]]|$)/ {
    fail("goto")
}

BEGIN { doc["label"] = "\
Please do not use labels.";
    level["label"] = '$ARI_INFO'
}
/^[[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*:/ \
    && ! /^[[:space:]]*default[[:space:]]*:/ {
    fail("label")
}

BEGIN { doc["codestream"] = "\
Several targets contain a codestream - aka instruction cache.  More than anything \
is is probably caused by the broken target stack.";
    level["codestream"] = '$ARI_INFO'
}
/codestream/ {
    fail("codestream")
}

BEGIN { doc["wrap_"] = "\
Several targets are using a wrapper function found in wrapper.c. \
Unfortunatly, they are hard to debug and contain a bad cast."
    level["wrap_"] = '$ARI_INFO'
}
/wrap_/ {
    fail("wrap_")
}

BEGIN { doc["var_auto_boolean"] = "\
Use the function add_set_auto_boolean_cmd() instead of var_auto_boolean.";
    bug("var_auto_boolean", "gdb/cli/cli-decode.c", 1)
    bug("var_auto_boolean", "gdb/cli/cli-decode.h", 1)
    bug("var_auto_boolean", "gdb/cli/cli-setshow.c", 2)
    bug("var_auto_boolean", "gdb/command.h", 1)
    level["var_auto_boolean"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])var_auto_boolean([^_[:alnum:]]|$)/ {
    fail("var_auto_boolean")
}

BEGIN { doc["var_boolean"] = "\
Use the function add_set_boolean_cmd() instead of var_boolean.";
    level["var_boolean"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])var_boolean([^_[:alnum:]]|$)/ {
    fail("var_boolean")
}

END {
    # Dump the documentation
    for (bug in doc) {
	if (! (bug in total)) {
	    total[bug] = 0
	}
    }
    for (bug in doc) {
	# ari.*.doc: <BUG>:<COUNT>:<LEVEL>:<DOC>
	print bug ":" total[bug] ":" level[bug] ":" doc[bug] >> "'${wwwdir}'/ari.source.doc"
    }
}' >${wwwdir}/ari.source.bug
Checking for doschk
Checking Makefile.in for non- -Werror rules
Create the ARI table (level 2)
/www/sourceware/htdocs/insight/ari/new.html:	 90.9%
Create the ARI table (level 4)
/www/sourceware/htdocs/insight/ari/new-ari.html:	 93.7%
total 473
-rw-rw-r--    1 gdbadmin insight      5901 Feb  9 20:15 ari.doschk.bug
-rw-rw-r--    1 gdbadmin insight      1495 Feb  9 20:15 ari.doschk.doc
-rw-rw-r--    1 gdbadmin insight      5675 Feb  9 20:15 ari.doschk.out
-rw-rw-r--    1 gdbadmin insight     27025 Feb  9 20:14 ari.doschk.sed
-rw-rw-r--    1 gdbadmin insight    109452 Feb  9 20:16 ari.html
-rw-rw-r--    1 gdbadmin insight      6860 Feb  9 20:16 ari.html.gz
-rw-rw-r--    1 gdbadmin insight         0 Feb  9 20:14 ari.source.bug
-rw-rw-r--    1 gdbadmin insight       508 Feb  9 20:15 ari.werror.bug
-rw-rw-r--    1 gdbadmin insight        86 Feb  9 20:15 ari.werror.doc
-rw-rw-r--    1 gdbadmin insight     24305 Feb  9 20:15 index.html
-rw-rw-r--    1 gdbadmin insight      2219 Feb  9 20:16 index.html.gz
-rw-rw-r--    1 gdbadmin insight    109452 Feb  9 20:16 new-ari.html
-rw-rw-r--    1 gdbadmin insight      6860 Feb  9 20:16 new-ari.html.gz
-rw-rw-r--    1 gdbadmin insight     24305 Feb  9 20:15 new.html
-rw-rw-r--    1 gdbadmin insight      2219 Feb  9 20:15 new.html.gz
-rw-rw-r--    1 gdbadmin insight    109452 Feb  9 20:16 old-ari.html
-rw-rw-r--    1 gdbadmin insight      6860 Feb  9 20:16 old-ari.html.gz
-rw-rw-r--    1 gdbadmin insight     24305 Feb  9 20:15 old.html
-rw-rw-r--    1 gdbadmin insight      2219 Feb  9 20:15 old.html.gz

+ sh ./update-web-docs /sourceware/ftp/anonftp/pub/gdb/snapshots/current/insight+dejagnu.tar.bz2 /sourceware/snapshot-tmp/insight+dejagnu-web-docs /www/sourceware/htdocs/insight/onlinedocs gdb
unpack the tar-ball
configure things
Create HTML files
Find all the HTML files in the repository, except those in directories
And copy the resulting html files to the web server
Create PDF documents
gdb.pdf:		 37.6%
gdbint.pdf:		 35.0%
stabs.pdf:		 35.7%
Create POSTSCRIPT documents
gdb.ps:			 69.0%
gdbint.ps:		 66.2%
refcard.ps:		 59.4%
stabs.ps:		 65.5%
create a very basic index.html

+ sh ./update-web-ari /sourceware/ftp/anonftp/pub/gdb/snapshots/5.1-branch/gdb+dejagnu.tar.bz2 /sourceware/snapshot-tmp/gdb+dejagnu-web-ari /www/sourceware/htdocs/gdb/5.1/ari gdb
Unpacking tar ball
Checking source code
awk: cmd. line:20: fatal error: internal error
./update-web-ari: line 1533:  1834 Broken pipe             find "${srcdir}/${project}" -name 'testsuite' -prune -o -name 'stop-gdb.c' -prune -o -name 'stuff.c' -prune -o -name '*-stub.c' -prune -o -name '*-share' -prune -o -name 'tui' -prune -o -name 'nlm' -prune -o -name 'gnu-regex.c' -prune -o -name 'gnu-regex.h' -prune -o -name '*\.tab\.c' -prune -o -name 'gdbserver' -prune -o -name '*.[hc]' -type f -print
      1835 Aborted                 | $AWK '
BEGIN {
    comment_p = 0
    string_p = 0
}

function fail (bug) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    if (fixit[bug, file] > 0) {
	fixit[bug, file] -= 1
    } else {
	print bug ":" 1 ":" level[bug] ":" file ":" FNR
	total[bug] += 1
    }
}

function bug (bug, file, count) {
    # ari.*.bug: <BUG>:<COUNT>:<LEVEL>:<FILE>:<LINE>
    # print bug ":" -count ":" level[bug] ":" file ":" 0
    fixit[bug, file] = count
}

# Load the list of files into an initially empty argument list.
# While STDIN is being parsed, ARGIND will remain zero.
ARGIND == 0 {
    ARGV[ARGC++] = $0;
    next;
}

# Initialize the PARSER
FNR == 1 {
    file = FILENAME;
    sub (/^.*\/'"${project}"'\//, "", file);
    file = "'"${project}"'/" file
    #printf " %s", file > "/dev/stderr";
    #fflush (/dev/stderr);
}

# Skip deprecated/obsolete lines
/(^|[^_[:alnum:]])DEPRECATED([^_[:alnum:]]|$)/ { next; }
/(^|[^_[:alnum:]])OBSOLETE([^_[:alnum:]]|$)/ { next; }

# Strip out comments
FNR == 1 { comment_p = 0; }
comment_p && /\*\// { gsub (/^([^\*]|\*+[^\/\*])*\*+\//, " "); comment_p = 0; }
comment_p { next; }
!comment_p { gsub (/\/\*([^\*]|\*+[^\/\*])*\*+\//, " "); }
!comment_p && /\/\*/ { gsub (/\/\*.*$/, " "); comment_p = 1; }

BEGIN { doc["error capital"] = "\
The error message should start with a capital but no one is sure of this"
    level["error capital"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^A-Z]*[^\/]"/ {
    fail("error capital")
}

BEGIN { doc["error full-stop"] = "\
The error message should not have a trailing full-stop"
    level["error full-stop"] = '$ARI_INFO'
}
/(^[^_[:alnum:]])error([^_[:alnum:]]|$)\([[:space:]]*"[^"]\."/ {
    fail("error full-stop")
}

# SNIP - Strip out strings - brain dead at present does not handle \" - SNIP

FNR == 1 { string_p = 0; }
string_p && /(^\"|[^\\]\")/ { gsub (/^([^\"]|\\\")*\"/, " "); string_p = 0; }
string_p { next; }
!string_p { gsub (/\"([^\"]|\\\")*\"/, " "); }
!string_p && /\"/ { gsub (/\"([^\"]|\\\")*$/, " "); string_p = 1; }

# Accumulate continuation lines
FNR == 1 { cont_p = 0; }
!cont_p { full_line = ""; }
/[^\\]\\$/ { gsub (/\\$/, ""); full_line = full_line $0; cont_p = 1; next; }
cont_p { $0 = full_line $0; cont_p = 0; full_line = ""; }


# GDB uses ISO C.  Check for any non pure ISO C code

BEGIN { doc["PARAMS"] = "\
Still uses the PARAMS macro.";
    level["PARAMS"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])PARAMS([^_[:alnum:]]|$)/ {
    fail("PARAMS")
}

BEGIN { doc["__STDC__"] = "\
GDB assumes ISO C, testing for __STDC__ makes little sense";
    level["__STDC__"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])__STDC__([^_[:alnum:]]|$)/ {
    fail("__STDC__")
}

BEGIN { doc["__CYGWIN32__"] = "\
__CYGWIN32__ has been replaced by __CYGWIN__ or, better, explicit \
autoconf tests";
    level["__CYGWIN32__"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])__CYGWIN32__([^_[:alnum:]]|$)/ {
    fail("__CYGWIN32__")
}

BEGIN { doc["PTR"] = "\
Use ``void *'\'\''.  PTR dates back to the days before ISO C.";
    level["PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])PTR([^_[:alnum:]]|$)/ {
    fail("PTR")
}

BEGIN { doc["CONST_PTR"] = "\
Use ``const void *'\'\''.  PTR dates back to the days before ISO C.";
    level["CONST_PTR"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])CONST_PTR([^_[:alnum:]]|$)/ {
    fail("CONST_PTR")
}

BEGIN { doc["grep ^func"] = "\
A function declaration with the function name positioned at the very start \
of a line.  Only as part of the function definition should the function \
name appear at the very start of a line.  This is so that \
``grep ^func'\'\'' works";
    level["grep ^func"] = '$ARI_WARNING'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:blank:]]*[^\*].*\);[[:blank:]]*/ {
    # FYI, it matches:
    #NAME (...);
    # when a normal declaration would have:
    #TYPE NAME (...);
    fail("grep ^func")
}

BEGIN { doc["K&R defn"] = "\
Still uses old style K&R function definition (not declaration) \
This check is BUGGY.  It appears to also  match things like a declaration \
where the function name is at the start of a line."
    level["K&R defn"] = '$ARI_ERROR'
}
/^[[:alnum:]_]+[[:blank:]]*\([[:alnum:]_]*[[:blank:]]*[,\)]/ && ! /\(void\)/ && ! /\);/ {
    fail("K&R defn")
}

BEGIN { doc["make_cleanup_func"] = "\
Type casting using make_cleanup_func is invalid ISO C";
    level["make_cleanup_func"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])make_cleanup_func([^_[:alnum:]]|$)/ {
    fail("make_cleanup_func")
}

BEGIN { doc["catch_errors_ftype"] = "\
Type casting using catch_errors_ftype is invalid ISO C";
    level["catch_errors_ftype"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors_ftype([^_[:alnum:]]|$)/ {
    fail("catch_errors_ftype")
}

BEGIN { doc["catch_errors"] = "\
Use catch_exceptions() in preference to catch_errors().";
    level["catch_errors"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])catch_errors[[:space:]]*\(/ {
    fail("catch_errors")
}

BEGIN { doc["strerror"] = "\
Use safe_strerror() in preference to strerror().";
    level["strerror"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])strerror[[:space:]]*\(/ {
    fail("strerror")
}

BEGIN { doc["long long"] = "\
Change ``long long'\'\'' to ``LONGEST'\'\''.";
    level["long long"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])long[[:space:]]+long([^_[:alnum:]]|$)/ {
    fail("long long")
}

BEGIN { doc["ATTRIBUTE_UNUSED"] = "\
GDB is compiled with -Werror and, consequently, is not able to tolerate \
false warnings.  Since -Wunused-param produces such warnings, neither \
that warning flag nor ATTRIBUTE_UNUSED are used in GDB."
    level["ATTRIBUTE_UNUSED"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])ATTRIBUTE_UNUSED([^_[:alnum:]]|$)/ {
    fail("ATTRIBUTE_UNUSED")
}

# General problems

BEGIN { doc["_func"] = "\
The suffixes ..._func and ..._ftype are used inconsistently in the source. \
Perhaps just ..._ftype should be used.";
    level["_func"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])[[:alpha:]_][[:alnum:]_]*_func([^_[:alnum:]]|$)/ {
    fail("_func")
}

BEGIN { doc["TARGET_BYTE_ORDER_SELECTABLE"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_SELECTABLE"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_SELECTABLE/ {
    fail("TARGET_BYTE_ORDER_SELECTABLE")
}

BEGIN { doc["TARGET_BYTE_ORDER_DEFAULT"] = "\
This macro is made redundant by multi-arch."
    level["TARGET_BYTE_ORDER_DEFAULT"] = '$ARI_REGRESSION'
}
/TARGET_BYTE_ORDER_DEFAULT/ {
    fail("TARGET_BYTE_ORDER_DEFAULT")
}

# Correct use of initialized?
BEGIN {
    doc["_initialize decl"] = "\
Declaration of _initialize*() missing.  The declaration stops a -Wmissing-declarations \
warning from GCC.";
    level["_initialize decl"] = '$ARI_INFO'
    doc["_initialize ftype"] = "\
Declaration of _initialize*() does not use initialize_file_ftype, should it?";
    level["_initialize ftype"] = '$ARI_INFO'
}
# Remember what type declaration, if any, we see
FNR == 1 {
    initialize_decl = 0;
    initialize_ftype = 0;
}
/^extern[[:space:]]+void[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_decl = 1
}
/^extern[[:space:]]+initialize_file_ftype[[:space:]]+_initialize_[_[:alnum:]]*/ {
    initialize_ftype = 1
}
# Check it against the definition
/^_initialize_[_[:alnum:]]*[[:space:]]+/ {
    if (!initialize_decl && !initialize_ftype) {
	fail("_initialize decl")
    }
    if (!initialize_ftype) {
	fail("_initialize ftype")
    }
}

# FIXME: Since strings are stripped, does this still work?
BEGIN { doc["error internal error"] = "\
Code should call the internal_error() function rather than print an \
internal-error message directly";
    level["error internal error"] = '$ARI_REGRESSION'
}
/error.*\"Internal error/ || /error.*\"internal error/ {
    fail("error internal error")
}

BEGIN { doc["inline"] = "\
Let the compiler decide if something needs to be made inline"
    level["inline"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {
    fail("inline")
}

BEGIN { doc["register"] = "\
Let the compiler decide if something needs to be made register"
    level["register"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])register([^_[:alnum:]]|$)/ {
    fail("register")
}

BEGIN { doc["return_to_top_level"] = "\
return_to_top_level() is deprecated in favor of the verror(), error_stream() \
et.al.";
    level["return_to_top_level"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])return_to_top_level[[:blank:]]*\(/ {
    fail("return_to_top_level")
}

BEGIN { doc["error_begin"] = "\
error_begin() is deprecated in favor of verror(), error_stream() et.al.";
    level["error_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])error_begin[[:blank:]]*\(/ {
    fail("error_begin")
}

BEGIN { doc["warning_begin"] = "\
warning_begin() is deprecated in favor of vwarning(), warning_stream() \
et.al. (see error_begin())";
    level["warning_begin"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])warning_begin[[:blank:]]*\(/ {
    fail("warning_begin")
}

BEGIN { doc["sizeof (CORE_ADDR)"] = "\
CORE_ADDR is not the same size as the host/target address.  Use TARGET_PTR_BIT \
or TARGET_ADDR_BIT.";
    level["sizeof (CORE_ADDR)"] = '$ARI_WARNING'
}
/sizeof[[:blank:]]*(CORE_ADDR)/ {
    fail("sizeof (CORE_ADDR)")
}

BEGIN { doc["REGNO"] = "\
Use the ..._REGNUM instead of the ..._REGNO name suffix";
    level["REGNO"] = '$ARI_WARNING'
}
/_REGNO([^_[:alnum:]]|$)/ || /_regno([^_[:alnum:]]|$)/ {
    fail("REGNO")
}

BEGIN { doc["abort"] = "\
GDB should never abort - use internal_error()";
    level["abort"] = '$ARI_REGRESSION'
    bug("abort", "gdb/utils.c", 3)
}
/(^|[^_[:alnum:]])abort[[:blank:]]*\(/ {
    fail("abort")
}

BEGIN { doc["basename"] = "\
GDB should never basename - use ``const char *lbasename(const char *)'\'\''";
    level["basename"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])basename[[:blank:]]*\(/ {
    fail("basename")
}

BEGIN { doc["assert"] = "\
GDB should never use assert().  Assert() calls abort() and GDB should \
not abort.  Use internal_error() or gdb_assert() instead.";
    level["assert"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])assert[[:blank:]]*\(/ {
    fail("assert")
}

BEGIN { doc["sizeof CORE_ADDR"] = "\
Taking the sizeof a CORE_ADDR is potentially dangerous.  CORE_ADDR is at \
least as big as the target pointer, _not_ the same size."
    level["sizeof CORE_ADDR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sizeof[:blank:]*\(CORE_ADDR\)/ {
    fail("sizeof CORE_ADDR")
}

BEGIN { doc["CORE_ADDR cast"] = "\
Casting something to a CORE_ADDR is typically dangerous and non-portable. \
(The data from this pattern may be wrong)";
    level["CORE_ADDR cast"] = '$ARI_WARNING'
}
/\(CORE_ADDR\)[:blank:]*[^,);]/ {
    fail("CORE_ADDR cast")
}

BEGIN { doc["QUIT"] = "\
Uses QUIT which could be unsafe. Should it instead use ``if (QUIT_P ()) \
return ...;'\'\'' (which does not yet exist)."
    level["QUIT"] = '$ARI_INFO'
}
/QUIT[[:blank:]]*[^;]/ {
    fail("QUIT")
}

BEGIN { doc["quit_flag"] = "\
Uses ``quit_flag'\'\''.  Should it instead use ``if (QUIT_P ()) ...'\'\'' \
(which does not yet exist).";
    level["quit_flag"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])quit_flag([^_[:alnum:]]|$)/ {
    fail("quit_flag")
}

BEGIN { doc["extern"] = "\
An ``extern'\'\'' declaration appears in a .c file";
    level["extern"] = '$ARI_WARNING'
    bug("extern", "gdb/ser-go32.c", 1) # extern *environ;
}
/^[[:blank:]]*extern[[:blank:]]*/ && ! /_initialize_/ && file ~ /\.c$/ { 
    fail("extern")
}

BEGIN { doc["#define"] = "\
Delcare an enum in preference to define a macro. ???";
    level["#define"] = '$ARI_INFO'
}
/^[[:blank:]]*#define[[:blank:]]+[[:alnum:]_]+[[:blank:]]+/ {
    fail("#define")
}

BEGIN { doc["#if"] = "\
Use an if statement in preference to conditionally compiled code. ???";
    level["#if"] = '$ARI_INFO'
}
/^[[:blank:]]*#if/ && ! / HAVE_/ {
    fail("#if")
}

BEGIN { doc["GDBTK"] = "\
#ifdef GDBTK should not be needed.";
    level["GDBTK"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])GDBTK([^_[:alnum:]]|$)/ {
    fail("GDBTK")
}

BEGIN { doc["TUI"] = "\
#ifdef TUI should not be needed.";
    level["TUI"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])TUI([^_[:alnum:]]|$)/ {
    fail("TUI")
}

BEGIN { doc["HAVE_VFORK"] = "\
#ifdef HAVE_VFORK is redundant.  Include \"gdb_vfork.h\" and call vfork() \
unconditionally.";
    level["HAVE_VFORK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HAVE_VFORK([^_[:alnum:]]|$)/ {
    fail("HAVE_VFORK")
}

BEGIN { doc["DEBUG"] = "\
Nothing should depend on a macro like DEBUG"
    level["DEBUG"] = '$ARI_INFO'
}
/^#if.*DEBUG/ {
    fail("DEBUG")
}

BEGIN { doc["union"] = "\
The union construct always leads to problems...";
    level["union"] = '$ARI_INFO'
}
/[[:blank:]]*union[[:blank:]]*/ {
    fail("union")
}

BEGIN { doc["unsafe getpkt"] = "\
Function that can call longjmp.";
    level["unsafe getpkt"] = '$ARI_INFO'
}
/^[^_[:alnum:]]getpkt([^_[:alnum:]]|$)/ {
    fail("unsafe getpkt")
}

BEGIN { doc["unsafe error"] = "\
Function that can can call longjmp.";
    level["unsafe error"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])error[[:blank:]]*\(/ {
    fail("unsafe error")
}

BEGIN { doc["readchar"] = "\
Parameterise the remote serial read/write code with the serial device \
being read.";
    level["readchar"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])readchar[[:blank:]]*\(/ {
    fail("readchar")
}

BEGIN { doc["sigsetmask"] = "\
sigsetmask() is deprecated in favour of sigprocmask().";
    level["sigsetmask"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sigsetmask[[:blank:]]*\(/ {
    fail("sigsetmask")
}

BEGIN { doc["bcmp"] = "\
bcmp() is deprecated in favor of the ISO C function memcmp().";
    level["bcmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])bcmp[[:blank:]]*\(/ {
    fail("bcmp")
}

BEGIN { doc["bzero"] = "\
bzero() id deprecated in favour of the ISO C function memset().";
    level["bzero"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bzero[[:blank:]]*\(/ {
    fail("bzero")
}

BEGIN { doc["bcopy"] = "\
bcopy() id deprecated in favour of the ISO C functions memcpy() and \
memmove().";
    level["bcopy"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])bcopy[[:blank:]]*\(/ {
    fail("bcopy")
}

BEGIN { doc["atoi"] = "\
Use strtol() instead of atoi().  The latter has a habit of accepting dud \
strings.";
    level["atoi"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])atoi[[:blank:]]*\(/ {
    fail("atoi")
}

BEGIN { doc["printf"] = "\
All GDB output should use the *printf*filtered() functions.";
    level["printf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])printf[[:blank:]]*\(/ {
    fail("printf")
}

BEGIN { doc["%p"] = "\
Use %s and paddr() to print target addresses, not %p.";
    level["%p"] = '$ARI_REGRESSION'
}
/%p/ {
    fail("%p")
}

BEGIN { doc["extract_floating"] = "\
GDB should use extract_typed_floating().";
    level["extract_floating"] = '$ARI_WARNING'
    bug("extract_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])extract_floating[[:blank:]]*\(/ {
    fail("extract_floating")
}

BEGIN { doc["store_floating"] = "\
GDB should use store_typed_floating().";
    level["store_floating"] = '$ARI_WARNING'
    bug("store_floating", "gdb/floatformat.c", 1)
}
/(^|[^_[:alnum:]])store_floating[[:blank:]]*\(/ {
    fail("store_floating")
}

BEGIN { doc["floatformat_to_double"] = "\
GDB should use floatformat_to_doublest().";
    level["floatformat_to_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_to_double[[:blank:]]*\(/ {
    fail("floatformat_to_double")
}

BEGIN { doc["floatformat_from_double"] = "\
GDB should use floatformat_from_doublest().";
    level["floatformat_from_double"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])floatformat_from_double[[:blank:]]*\(/ {
    fail("floatformat_from_double")
}

BEGIN { doc["floatformat_arm_ext"] = "\
GDB should use floatformat_arm_big or floatformat_arm_littlebyte_bigword.";
    level["floatformat_arm_ext"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])floatformat_arm_ext([^_[:alnum:]]|$)/ {
    fail("floatformat_arm_ext")
}

BEGIN { doc["IEEE_FLOAT"] = "\
The macro IEEE_FLOAT is no longer needed.";
    level["IEEE_FLOAT"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])IEEE_FLOAT([^_[:alnum:]]|$)/ {
    fail("IEEE_FLOAT")
}

BEGIN { doc["FLOAT_INFO"] = "\
The macro FLOAT_INFO is deprecated in favour of PRINT_FLOAT_INFO.";
    level["FLOAT_INFO"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])FLOAT_INFO([^_[:alnum:]]|$)/ {
    fail("FLOAT_INFO")
}

BEGIN { doc["INVALID_FLOAT"] = "\
The macro INVALID_FLOAT was just just wierd.";
    level["INVALID_FLOAT"] = '$ARI_REGRESSION'
    bug("INVALID_FLOAT", "gdb/vax-tdep.c", 3);
}
/(^|[^_[:alnum:]])INVALID_FLOAT([^_[:alnum:]]|$)/ {
    fail("INVALID_FLOAT")
}

BEGIN { doc["HOST_BYTE_ORDER"] = "\
The macro HOST_BYTE_ORDER is not used.";
    level["HOST_BYTE_ORDER"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])HOST_BYTE_ORDER([^_[:alnum:]]|$)/ {
    fail("HOST_BYTE_ORDER")
}

BEGIN { doc["BIG_ENDIAN"] = "\
The macro BIG_ENDIAN is being replaced with BFD_ENDIAN_BIG.";
    level["BIG_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])BIG_ENDIAN([^_[:alnum:]]|$)/ {
    fail("BIG_ENDIAN")
}

BEGIN { doc["LITTLE_ENDIAN"] = "\
The macro LITTLE_ENDIAN is being replaced with BFD_ENDIAN_LITTLE.";
    level["LITTLE_ENDIAN"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])LITTLE_ENDIAN([^_[:alnum:]]|$)/ {
    fail("LITTLE_ENDIAN")
}

BEGIN { doc["report_transfer_performance"] = "\
?????";
    level["report_transfer_performance"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])report_transfer_performance([^_[:alnum:]]|$)/ {
    fail("report_transfer_performance")
}

BEGIN { doc["DECR_PC_AFTER_BREAK"] = "\
I wish this would just go away.";
    level["DECR_PC_AFTER_BREAK"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DECR_PC_AFTER_BREAK([^_[:alnum:]]|$)/ {
    fail("DECR_PC_AFTER_BREAK")
}

BEGIN { doc["USG"] = "\
What does USG even tell us?";
    level["USG"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])USG([^_[:alnum:]]|$)/ {
    fail("USG")
}

BEGIN { doc["EXTRA_FRAME_INFO"] = "\
The macro EXTRA_FRAME_INFO is replaced by struct frame_extra_info.";
    level["EXTRA_FRAME_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])EXTRA_FRAME_INFO([^_[:alnum:]]|$)/ {
    fail("EXTRA_FRAME_INFO")
}

BEGIN { doc["FRAME_FIND_SAVED_REGS"] = "\
The macro FRAME_FIND_SAVED_REGS is replaced by FRAME_INIT_SAVED_REGS.";
    level["FRAME_FIND_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])FRAME_FIND_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("FRAME_FIND_SAVED_REGS")
}

BEGIN { doc["SIZEOF_FRAME_SAVED_REGS"] = "\
The macro SIZEOF_FRAME_SAVED_REGS typically should not be needed.";
    level["SIZEOF_FRAME_SAVED_REGS"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])SIZEOF_FRAME_SAVED_REGS([^_[:alnum:]]|$)/ {
    fail("SIZEOF_FRAME_SAVED_REGS")
}

BEGIN { doc["strsignal"] = "\
GDB should be using the ABI to convert a signal into a string?";
    level["strsignal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strsignal[[:blank:]]*\(/ {
    fail("strsignal")
}

BEGIN { doc["target_signal"] = "\
This is really badly named.  It should be called something like gdb_signal \
as it is GDBs internal representation of the target signal.  It gets worse \
as target_signal_to_host() is actually translating to/from the true target \
signal.";
    level["target_signal"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])target_signal([^_[:alnum:]]|$)/ {
    fail("target_signal")
}

# The register cache and the addition of a frame argument.

BEGIN { doc["registers []"] = "\
Too many cases of code just blatting registers[].  Use existing interfaces \
and mechanisms.";
    level["registers []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers([^_[:alnum:]]|$)/ && ! /->registers([^_[:alnum:]]|$)/ {
    fail("registers []")
}

BEGIN { doc["register_valid []"] = "\
Too many cases of code just blatting register_valid[].  Use existing \
interfaces and mechanisms.";
    level["register_valid []"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_valid([^_[:alnum:]]|$)/ {
    fail("register_valid []")
}

BEGIN { doc["read_register_gen in target"] = "\
Target and nat code should fetch values from the cache using \
regcache_collect()."
    level["read_register_gen in target"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])read_register_gen([^_[:alnum:]]|$)/ && file ~ /.*-nat\.c/ {
    fail("read_register_gen in target")
}

BEGIN { doc["read_register_bytes"] = "\
read_register_bytes() should be avoided, or its semantics fixed.";
    level["read_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])read_register_bytes[[:blank:]]*\(/ {
    fail("read_register_bytes")
}

BEGIN { doc["write_register_bytes"] = "\
write_register_bytes() should be avoided, or its semantics fixed.";
    level["write_register_bytes"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])write_register_bytes[[:blank:]]*\(/ {
    fail("write_register_bytes")
}

BEGIN { doc["registers_fetched"] = "\
registers_fetched() is replaced by supply_register().";
    level["registers_fetched"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])registers_fetched[[:blank:]]*\(/ {
    fail("registers_fetched")
}

BEGIN { doc["register_buffer"] = "\
register_buffer() is replaced by supply_register().";
    level["register_buffer"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])register_buffer[[:blank:]]*\(/ {
    fail("register_buffer")
}

BEGIN { doc["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = "\
DEPRECATED_CLEAN_UP_REGISTER_VALUE() is replaced with \
gdbarch_register_write().";
    level["DEPRECATED_CLEAN_UP_REGISTER_VALUE"] = '$ARI_DEPRECATED'
}
/(^|[^_[:alnum:]])DEPRECATED_CLEAN_UP_REGISTER_VALUE([^_[:alnum:]]|$)/ {
    fail("DEPRECATED_CLEAN_UP_REGISTER_VALUE")
}

BEGIN { doc["REGISTER_NAME_ALIAS_HOOK"] = "\
REGISTER_NAME_ALIAS_HOOK() is obsolete.";
    level["REGISTER_NAME_ALIAS_HOOK"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])REGISTER_NAME_ALIAS_HOOK[[:blank:]]*\(/ {
    fail("REGISTER_NAME_ALIAS_HOOK")
}

BEGIN { doc["STORE_PSEUDO_REGISTER"] = "\
STORE_PSEUDO_REGISTER() is replaced with gdbarch_register_write().";
    level["STORE_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STORE_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])store_pseudo_register[[:blank:]]*\(/ {
    fail("STORE_PSEUDO_REGISTER")
}

BEGIN { doc["FETCH_PSEUDO_REGISTER"] = "\
FETCH_PSEUDO_REGISTER() is replaced by gdbarch_register_read().";
    level["FETCH_PSEUDO_REGISTER"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])FETCH_PSEUDO_REGISTER[[:blank:]]*\(/ \
|| /(^|[^_[:alnum:]])fetch_pseudo_register[[:blank:]]*\(/ {
    fail("FETCH_PSEUDO_REGISTER")
}

BEGIN { doc["IS_TRAPPED_INTERNALVAR"] = "\
IS_TRAPPED_INTERNALVAR() is replaced by gdbarch_register_read().";
    level["IS_TRAPPED_INTERNALVAR"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])IS_TRAPPED_INTERNALVAR[[:blank:]]*\(/ {
    fail("IS_TRAPPED_INTERNALVAR")
}

BEGIN { doc["REGISTER_BYTE"] = "\
REGISTER_BYTE can be computed at run time.  Should be local to regcache.c.";
    level["REGISTER_BYTE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTE[[:blank:]]*\(/ {
    fail("REGISTER_BYTE")
}

BEGIN { doc["REGISTER_BYTES"] = "\
REGISTER_BYTES the size of the regcache can be computed at run time.";
    level["REGISTER_BYTES"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_BYTES[[:blank:]]*\(/ {
    fail("REGISTER_BYTES")
}

BEGIN { doc["REGISTER_VIRTUAL_SIZE"] = "\
REGISTER_VIRTUAL_SIZE() can be computed at runtime.";
    level["REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_VIRTUAL_SIZE"] = "\
MAX_REGISTER_VIRTUAL_SIZE() can be computed at run time.";
    level["MAX_REGISTER_VIRTUAL_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_VIRTUAL_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_VIRTUAL_SIZE")
}

BEGIN { doc["MAX_REGISTER_RAW_SIZE"] = "\
MAX_REGISTER_RAW_SIZE() can be computed from REGISTER_RAW_SIZE().";
    level["MAX_REGISTER_RAW_SIZE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])MAX_REGISTER_RAW_SIZE[[:blank:]]*\(/ {
    fail("MAX_REGISTER_RAW_SIZE")
}

BEGIN { doc["DO_REGISTERS_INFO"] = "\
DO_REGISTERS_INFO() should be replaced by FRAME_REGISTERS_INFO.";
    level["DO_REGISTERS_INFO"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])DO_REGISTERS_INFO[[:blank:]]*\(/ {
    fail("DO_REGISTERS_INFO")
}

BEGIN { doc["REGISTER_CONVERTIBLE"] = "\
REGISTER_CONVERTIBLE() has overloaded semantics.";
    level["REGISTER_CONVERTIBLE"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERTIBLE[[:blank:]]*\(/ {
    fail("REGISTER_CONVERTIBLE")
}

BEGIN { doc["REGISTER_CONVERT_TO_RAW"] = "\
REGISTER_CONVERT_TO_RAW() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_RAW"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_RAW[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_RAW")
}

BEGIN { doc["REGISTER_CONVERT_TO_VIRTUAL"] = "\
REGISTER_CONVERT_TO_VIRTUAL() has overloaded semantics.";
    level["REGISTER_CONVERT_TO_VIRTUAL"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])REGISTER_CONVERT_TO_VIRTUAL[[:blank:]]*\(/ {
    fail("REGISTER_CONVERT_TO_VIRTUAL")
}

# Print functions: Use versions that either check for buffer overflow
# or safely allocate a fresh buffer.

BEGIN { doc["sprintf"] = "\
sprintf() should be avoided.  Use either xasprintf() or snprintf().";
    level["sprintf"] = '$ARI_WARNING'
}
/(^|[^_[:alnum:]])sprintf[[:blank:]]*\(/ {
    fail("sprintf")
}

BEGIN { doc["vsprint"] = "\
vsprint() should be avoided.  Use either xvasprint() or vsnprintf().";
    level["vsprint"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vsprint[[:blank:]]*\(/ {
    fail("vsprint")
}

BEGIN { doc["asprintf"] = "\
asprintf() is deprecated in favour of xasprintf().";
    level["asprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])asprintf[[:blank:]]*\(/ {
    fail("asprintf")
}

BEGIN { doc["vasprintf"] = "\
vasprintf() is deprecated in favour of xvasprintf().";
    bug("vasprintf", "gdb/utils.c", 1)
    level["vasprintf"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])vasprintf[[:blank:]]*\(/ {
    fail("vasprintf")
}

# Memory allocation: malloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["malloc"] = "\
GDB uses xmalloc() and not malloc()";
    level["malloc"] = '$ARI_REGRESSION';
    bug("malloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])malloc[[:blank:]]*\(/ {
    fail("malloc")
}

BEGIN { doc["calloc"] = "\
GDB uses xcalloc() and not calloc()";
    level["calloc"] = '$ARI_REGRESSION';
    bug("calloc", "gdb/utils.c", 1);
}
/(^|[^_[:alnum:]])calloc[[:blank:]]*\(/ {
    fail("calloc")
}

BEGIN { doc["realloc"] = "\
GDB uses xrealloc() and not realloc()";
    level["realloc"] = '$ARI_REGRESSION';
    bug("realloc", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]])realloc[[:blank:]]*\(/ {
    fail("realloc")
}

BEGIN { doc["free"] = "\
GDB uses xfree() and not free().  xfree() can handle NULL.";
    level["free"] = '$ARI_REGRESSION';
    bug("free", "gdb/utils.c", 2); # decl, use
}
/(^|[^_[:alnum:]>\.])free[[:blank:]]*\(/ {
    fail("free")
}

# Memory allocation: mmalloc(): Use versions that check for NULL memory
# buffers.  gdb/utils.c contains wrappers that call the underlying
# functions.

BEGIN { doc["mmalloc"] = "\
GDB uses xmmalloc() and not mmalloc()";
    level["mmalloc"] = '$ARI_REGRESSION'
    bug("mmalloc", "gdb/utils.c", 4);
}
/(^|[^_[:alnum:]])mmalloc[[:blank:]]*\(/ {
    fail("mmalloc")
}

BEGIN { doc["mcalloc"] = "\
GDB uses xmcalloc() and not mcalloc()";
    level["mcalloc"] = '$ARI_REGRESSION'
    bug("mcalloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mcalloc[[:blank:]]*\(/ {
    fail("mcalloc")
}

BEGIN { doc["mrealloc"] = "\
GDB uses xmrealloc() and not mrealloc()";
    level["mrealloc"] = '$ARI_REGRESSION'
    bug("mrealloc", "gdb/utils.c", 2);
}
/(^|[^_[:alnum:]])mrealloc[[:blank:]]*\(/ {
    fail("mrealloc")
}

BEGIN { doc["mfree"] = "\
GDB uses xmfree() and not mfree()";
    level["mfree"] = '$ARI_REGRESSION'
    bug("mfree", "gdb/utils.c", 3);
}
/(^|[^_[:alnum:]>\.])mfree[[:blank:]]*\(/ {
    fail("mfree")
}

# Memory allocation: xmmalloc(): We are trying to eliminate these
# versions and just use simple xmalloc() and obstacks.

BEGIN { doc["xmmalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmmalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmmalloc[[:blank:]]*\(/ {
    fail("xmmalloc")
}

BEGIN { doc["xmcalloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmcalloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmcalloc[[:blank:]]*\(/ {
    fail("xmcalloc")
}

BEGIN { doc["xmrealloc"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmrealloc"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])xmrealloc[[:blank:]]*\(/ {
    fail("xmrealloc")
}

BEGIN { doc["xmfree"] = "\
GDB is trying to elminate the [x]mmalloc() family.";
    level["xmfree"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]>\.])xmfree[[:blank:]]*\(/ {
    fail("xmfree")
}

# More generic memory operations

BEGIN { doc["FREEIF"] = "\
GDB uses xfree() and not FREEIF()";
    level["FREEIF"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])FREEIF[[:blank:]]*\(/ {
    fail("FREEIF")
}

BEGIN { doc["MALLOC_INCOMPATIBLE"] = "\
MALLOC_INCOMPATIBLE should be handled by autoconf.";
    level["MALLOC_INCOMPATIBLE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])MALLOC_INCOMPATIBLE([^_[:alnum:]]|$)/ {
    fail("MALLOC_INCOMPATIBLE")
}

BEGIN { doc["strdup"] = "\
GDB uses xstrdup() and not strdup()";
    level["strdup"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strdup[[:blank:]]*\(/ {
    fail("strdup")
}

BEGIN { doc["strsave"] = "\
strsave() is deprecated in favour of xstrdup() et.al.";
    level["strsave"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strsave[[:blank:]]*\(/ {
    fail("strsave")
}

BEGIN { doc["savestring"] = "\
savestring() needs a rethink.  Should there be a xstrldup() (???).";
    level["savestring"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])savestring[[:blank:]]*\(/ {
    fail("savestring")
}

BEGIN { doc["alloca"] = "\
alloca() is non-portable but its use is tolerated";
    level["alloca"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])alloca[[:blank:]]*\(/ {
    fail("alloca")
}

# String compare functions

BEGIN { doc["STREQ"] = "\
Use ``strcmp() == 0'\'\'' instead of STREQ()."
    level["STREQ"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQ[[:blank:]]*\(/ {
    fail("STREQ")
}

BEGIN { doc["STRCMP"] = "\
Use ``strcmp() == 0'\'\'' instead of STRCMP()"
    level["STRCMP"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])STRCMP[[:blank:]]*\(/ {
    fail("STRCMP")
}

BEGIN { doc["STREQN"] = "\
Use ``strncmp() == 0'\'\'' instead of STREQN()"
    level["STREQN"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])STREQN[[:blank:]]*\(/ {
    fail("STREQN")
}

BEGIN { doc["strncpy"] = "\
Uses strncpy instead of strlcpy (which does not yet exist)";
    level["strncpy"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])strncpy[[:blank:]]*\(/ {
    fail("strncpy")
}

BEGIN { doc["!strcmp"] = "\
Use ``strcmp() == 0'\'\'' rather than ``!strcmp()'\'\''.  Correctly \
understanding ``string-compare equals ...'\'\'' is easier than the \
backward logic of ``Not string-compare'\'\''.";
    level["!strcmp"] = '$ARI_INFO'
}
/\![[:blank:]]*str/ {
    fail("!strcmp")
}

BEGIN { doc["strnicmp"] = "\
GDB uses strncasecmp() and not strnicmp()";
    level["strnicmp"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])strnicmp[[:blank:]]*\(/ {
    fail("strnicmp")
}

# Boolean expressions and conditionals

BEGIN { doc["FALSE"] = "\
Definitely do not use FALSE in boolean expressions.";
    level["FALSE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])FALSE([^_[:alnum:]]|$)/ {
    fail("FALSE")
}

BEGIN { doc["TRUE"] = "\
Do not try to use TRUE in boolean expressions.";
    level["TRUE"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])TRUE([^_[:alnum:]]|$)/ {
    fail("TRUE")
}

BEGIN { doc["false"] = "\
Definitely do not use ``false'\'\'' in boolean expressions.";
    level["false"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ {
    fail("false")
}

BEGIN { doc["true"] = "\
Do not try to use ``true'\'\'' in boolean expressions.";
    level["true"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ {
    fail("true")
}

BEGIN { doc["if assignment"] = "\
An IF statement'\''s expression includes an assignment.";
    level["if assignment"] = '$ARI_INFO'
}
/ if .* = / {
    fail("if assignment")
}

# Include files for which GDB has a custom version.

BEGIN { doc["assert.h"] = "\
Instead of assert.h, use gdb_assert.h";
    level["assert.h"] = '$ARI_REGRESSION'
    bug("assert.h", "gdb/gdb_assert.h", 0) # it does not use it
}
/^[[:blank:]]*\#[[:blank:]]*include[[:blank:]]+.assert\.h./ {
    fail("assert.h")
}

BEGIN { doc["dirent.h"] = "\
Instead of dirent.h, use gdb_dirent.h";
    level["dirent.h"] = '$ARI_REGRESSION'
    bug("dirent.h", "gdb/gdb_dirent.h", 1);
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.dirent\.h./ {
    fail("dirent.h")
}

BEGIN { doc["proc_service.h"] = "\
Instead of proc_service.h, use gdb_proc_service.h";
    level["proc_service.h"] = '$ARI_WARNING'
    bug("proc_service.h", "gdb/gdb_proc_service.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.proc_service\.h./ {
    fail("proc_service.h")
}

BEGIN { doc["regex.h"] = "\
Instead of regex.h, use gdb_regex.h";
    level["regex.h"] = '$ARI_REGRESSION'
    bug("regex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.regex\.h./ {
    fail("regex.h")
}

BEGIN { doc["xregex.h"] = "\
Instead of xregex.h, use gdb_regex.h";
    level["xregex.h"] = '$ARI_REGRESSION'
    bug("xregex.h", "gdb/gdb_regex.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.xregex\.h./ {
    fail("xregex.h")
}

BEGIN { doc["gnu-regex.h"] = "\
Instead of gnu-regex.h, use gdb_regex.h";
    level["gnu-regex.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.gnu-regex\.h./ {
    fail("gnu regex.h")
}

BEGIN { doc["stat.h"] = "\
Instead of stat.h or sys/stat.h, use gdb_stat.h";
    level["stat.h"] = '$ARI_ERROR'
    bug("stat.h", "gdb/gdb_stat.h", 1)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.stat\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/stat\.h./ {
    fail("stat.h")
}

BEGIN { doc["string.h"] = "\
Instead of string.h, strings.h or memory.h, use gdb_string.h";
    level["string.h"] = '$ARI_REGRESSION'
    bug("string.h", "gdb/gdb_string.h", 4)
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.string\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.strings\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.memory\.h./ {
    fail("string.h")
}

BEGIN { doc["thread_db.h"] = "\
Instead of thread_db.h, use gdb_thread_db.h";
    bug("thread_db.h", "gdb/gdb_thread_db.h", 1);
    level["thread_db.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.thread_db\.h./ {
    fail("thread_db.h")
}

BEGIN { doc["wait.h"] = "\
Instead of wait.h or sys/wait.h, use gdb_wait.h";
    bug("wait.h", "gdb/gdb_wait.h", 2);
    level["wait.h"] = '$ARI_WARNING'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.wait\.h./ \
|| /^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.sys\/wait\.h./ {
    fail("wait.h")
}

BEGIN { doc["vfork.h"] = "\
Instead of vfork.h, use gdb_vfork.h";
    bug("vfork.h", "gdb/gdb_vfork.h", 1);
    level["vfork.h"] = '$ARI_REGRESSION'
}
/^[[:blank:]]*\#[[:blank:]]*[[:blank:]]*include[[:blank:]]*.vfork\.h./ {
    fail("vfork.h")
}

# Typedefs that are either redundant or can be reduced to ``struct
# type *''.

BEGIN { doc["GDB_FILE"] = "\
GDB_FILE is deprecated in favor of ``struct ui_file'\'\''";
    level["GDB_FILE"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])GDB_FILE([^_[:alnum:]]|$)/ {
    fail("GDB_FILE")
}

BEGIN { doc["struct complaint"] = "\
``struct complaint'\'\'' is just nasty and over complex - hashing the \
format string would probably have done the trick";
    level["struct complaint"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])struct complaint([^_[:alnum:]]|$)/ {
    fail("struct complaint")
}

BEGIN { doc["serial_t"] = "\
Change serial_t to ``struct serial'\'\''.";
    level["serial_t"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])serial_t([^_[:alnum:]]|$)/ {
    fail("serial_t")
}

BEGIN { doc["value_ptr"] = "\
Change value_ptr to ``struct value *'\'\''.";
    level["value_ptr"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])value_ptr([^_[:alnum:]]|$)/ {
    fail("value_ptr")
}

BEGIN { doc["tm_print_insn"] = "\
tm_print_insn has been multi-arched.";
    level["tm_print_insn"] = '$ARI_WARNING'
}
/tm_print_insn[[:space:]]*=/ {
    fail("tm_print_insn")
}

BEGIN { doc["goto"] = "\
Please do not use ``goto'\'\''.";
    level["goto"] = '$ARI_INFO'
}
/(^|[^_[:alnum:]])goto([^_[:alnum:]]|$)/ {
    fail("goto")
}

BEGIN { doc["label"] = "\
Please do not use labels.";
    level["label"] = '$ARI_INFO'
}
/^[[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*:/ \
    && ! /^[[:space:]]*default[[:space:]]*:/ {
    fail("label")
}

BEGIN { doc["codestream"] = "\
Several targets contain a codestream - aka instruction cache.  More than anything \
is is probably caused by the broken target stack.";
    level["codestream"] = '$ARI_INFO'
}
/codestream/ {
    fail("codestream")
}

BEGIN { doc["wrap_"] = "\
Several targets are using a wrapper function found in wrapper.c. \
Unfortunatly, they are hard to debug and contain a bad cast."
    level["wrap_"] = '$ARI_INFO'
}
/wrap_/ {
    fail("wrap_")
}

BEGIN { doc["var_auto_boolean"] = "\
Use the function add_set_auto_boolean_cmd() instead of var_auto_boolean.";
    bug("var_auto_boolean", "gdb/cli/cli-decode.c", 1)
    bug("var_auto_boolean", "gdb/cli/cli-decode.h", 1)
    bug("var_auto_boolean", "gdb/cli/cli-setshow.c", 2)
    bug("var_auto_boolean", "gdb/command.h", 1)
    level["var_auto_boolean"] = '$ARI_REGRESSION'
}
/(^|[^_[:alnum:]])var_auto_boolean([^_[:alnum:]]|$)/ {
    fail("var_auto_boolean")
}

BEGIN { doc["var_boolean"] = "\
Use the function add_set_boolean_cmd() instead of var_boolean.";
    level["var_boolean"] = '$ARI_ERROR'
}
/(^|[^_[:alnum:]])var_boolean([^_[:alnum:]]|$)/ {
    fail("var_boolean")
}

END {
    # Dump the documentation
    for (bug in doc) {
	if (! (bug in total)) {
	    total[bug] = 0
	}
    }
    for (bug in doc) {
	# ari.*.doc: <BUG>:<COUNT>:<LEVEL>:<DOC>
	print bug ":" total[bug] ":" level[bug] ":" doc[bug] >> "'${wwwdir}'/ari.source.doc"
    }
}' >${wwwdir}/ari.source.bug
Checking for doschk
Checking Makefile.in for non- -Werror rules
Create the ARI table (level 2)
/www/sourceware/htdocs/gdb/5.1/ari/new.html:	 87.6%
Create the ARI table (level 4)
/www/sourceware/htdocs/gdb/5.1/ari/new-ari.html:	 92.5%
total 264
-rw-rw-r--    1 gdbadmin gdb          3753 Feb  9 20:51 ari.doschk.bug
-rw-rw-r--    1 gdbadmin gdb           628 Feb  9 20:51 ari.doschk.doc
-rw-rw-r--    1 gdbadmin gdb          3638 Feb  9 20:51 ari.doschk.out
-rw-rw-r--    1 gdbadmin gdb         26661 Feb  9 20:50 ari.doschk.sed
-rw-r--r--    1 gdbadmin gdb         58012 Feb  9 20:51 ari.html
-rw-r--r--    1 gdbadmin gdb          4341 Feb  9 20:51 ari.html.gz
-rw-rw-r--    1 gdbadmin gdb             0 Feb  9 20:50 ari.source.bug
-rw-rw-r--    1 gdbadmin gdb           508 Feb  9 20:51 ari.werror.bug
-rw-rw-r--    1 gdbadmin gdb            86 Feb  9 20:51 ari.werror.doc
-rw-r--r--    1 gdbadmin gdb         10113 Feb  9 20:51 index.html
-rw-r--r--    1 gdbadmin gdb          1273 Feb  9 20:51 index.html.gz
-rw-rw-r--    1 gdbadmin gdb         58012 Feb  9 20:51 new-ari.html
-rw-rw-r--    1 gdbadmin gdb          4341 Feb  9 20:51 new-ari.html.gz
-rw-rw-r--    1 gdbadmin gdb         10113 Feb  9 20:51 new.html
-rw-rw-r--    1 gdbadmin gdb          1273 Feb  9 20:51 new.html.gz
-rw-r--r--    1 gdbadmin gdb         58012 Feb  9 20:51 old-ari.html
-rw-r--r--    1 gdbadmin gdb          4341 Feb  9 20:51 old-ari.html.gz
-rw-r--r--    1 gdbadmin gdb         10113 Feb  9 20:51 old.html
-rw-r--r--    1 gdbadmin gdb          1273 Feb  9 20:51 old.html.gz

+ sh ./update-web-docs /sourceware/ftp/anonftp/pub/gdb/snapshots/5.1-branch/gdb+dejagnu.tar.bz2 /sourceware/snapshot-tmp/gdb+dejagnu-web-docs /www/sourceware/htdocs/gdb/5.1/onlinedocs gdb
unpack the tar-ball
configure things
Create HTML files
Find all the HTML files in the repository, except those in directories
And copy the resulting html files to the web server
Create PDF documents
gdb.pdf:		 37.6%
gdbint.pdf:		 37.4%
stabs.pdf:		 35.7%
Create POSTSCRIPT documents
gdb.ps:			 68.9%
gdbint.ps:		 66.5%
refcard.ps:		 59.4%
stabs.ps:		 65.5%
create a very basic index.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]