Move safe_strerror to common/
[deliverable/binutils-gdb.git] / gdb / contrib / ari / gdb_ari.sh
index b8ee06ffc84577e32fa208a750a99c918d41a4a0..b868a17e175950196c6f30ab3aafc1f352ff74dc 100644 (file)
@@ -2,7 +2,7 @@
 
 # GDB script to list of problems using awk.
 #
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2015 Free Software Foundation, Inc.
 #
 # This file is part of GDB.
 #
@@ -257,21 +257,6 @@ BEGIN {
 
 # Things in comments
 
-BEGIN { doc["GNU/Linux"] = "\
-Do not use `Linux'\'', instead use `Linux kernel'\'' or `GNU/Linux system'\'';\
- comments should clearly differentiate between the two (this test assumes that\
- word `Linux'\'' appears on the same line as the word `GNU'\'' or `kernel'\''\
- or a kernel version"
-    category["GNU/Linux"] = ari_comment
-}
-/(^|[^_[:alnum:]])Linux([^_[:alnum:]]|$)/ \
-&& !/(^|[^_[:alnum:]])Linux\[sic\]([^_[:alnum:]]|$)/ \
-&& !/(^|[^_[:alnum:]])GNU\/Linux([^_[:alnum:]]|$)/ \
-&& !/(^|[^_[:alnum:]])Linux kernel([^_[:alnum:]]|$)/ \
-&& !/(^|[^_[:alnum:]])Linux [[:digit:]]\.[[:digit:]]+)/ {
-    fail("GNU/Linux")
-}
-
 BEGIN { doc["ARGSUSED"] = "\
 Do not use ARGSUSED, unnecessary"
     category["ARGSUSED"] = ari_regression
@@ -321,14 +306,6 @@ Do not include assert.h, instead include \"gdb_assert.h\"";
     fail("assert.h")
 }
 
-BEGIN { doc["dirent.h"] = "\
-Do not include dirent.h, instead include gdb_dirent.h"
-    category["dirent.h"] = ari_regression
-}
-/^#[[:space:]]*include[[:space:]]*.dirent\.h./ {
-    fail("dirent.h")
-}
-
 BEGIN { doc["regex.h"] = "\
 Do not include regex.h, instead include gdb_regex.h"
     category["regex.h"] = ari_regression
@@ -355,19 +332,9 @@ Do not include gnu-regex.h, instead include gdb_regex.h"
     fail("gnu regex.h")
 }
 
-BEGIN { doc["stat.h"] = "\
-Do not include stat.h or sys/stat.h, instead include gdb_stat.h"
-    category["stat.h"] = ari_regression
-    fix("stat.h", "gdb/gdb_stat.h", 1)
-}
-/^#[[:space:]]*include[[:space:]]*.stat\.h./ \
-|| /^#[[:space:]]*include[[:space:]]*.sys\/stat\.h./ {
-    fail("stat.h")
-}
-
 BEGIN { doc["wait.h"] = "\
 Do not include wait.h or sys/wait.h, instead include gdb_wait.h"
-    fix("wait.h", "gdb/gdb_wait.h", 2);
+    fix("wait.h", "common/gdb_wait.h", 2);
     category["wait.h"] = ari_regression
 }
 /^#[[:space:]]*include[[:space:]]*.wait\.h./ \
@@ -558,7 +525,7 @@ Function name starts lower case but has uppercased letters."
     editCase_full_line = ""
 }
 (possible_editCase) {
-    if (ARI_OK == "ediCase function") {
+    if (ARI_OK == "editCase function") {
        possible_editCase = 0
     }
     # Closing brace found?
@@ -624,7 +591,11 @@ BEGIN { doc["OP eol"] = "\
 Do not use &&, or || at the end of a line"
     category["OP eol"] = ari_code
 }
-/(\|\||\&\&|==|!=)[[:space:]]*$/ {
+# * operator needs a special treatment as it can be a
+# valid end of line for a pointer type definition
+# Only catch case where an assignment or an opening brace is present
+/(\|\||\&\&|==|!=|[[:space:]][+\-\/])[[:space:]]*$/ \
+|| /(\(|=)[[:space:]].*[[:space:]]\*[[:space:]]*$/ {
     fail("OP eol")
 }
 
@@ -632,8 +603,8 @@ BEGIN { doc["strerror"] = "\
 Do not use strerror(), instead use safe_strerror()"
     category["strerror"] = ari_regression
     fix("strerror", "gdb/gdb_string.h", 1)
-    fix("strerror", "gdb/mingw-hdep.c", 1)
-    fix("strerror", "gdb/posix-hdep.c", 1)
+    fix("strerror", "gdb/common/mingw-strerror.c", 1)
+    fix("strerror", "gdb/common/posix-strerror.c", 1)
 }
 /(^|[^_[:alnum:]])strerror[[:space:]]*\(/ {
     fail("strerror")
@@ -767,7 +738,7 @@ Replace ADD_SHARED_SYMBOL_FILES with nothing, not needed?"
 
 BEGIN { doc["SOLIB_ADD"] = "\
 Replace SOLIB_ADD with nothing, not needed?"
-    category["SOLIB_ADD"] = ari_deprecate
+    category["SOLIB_ADD"] = ari_regression
 }
 /(^|[^_[:alnum:]])SOLIB_ADD([^_[:alnum:]]|$)/ {
     fail("SOLIB_ADD")
@@ -775,7 +746,7 @@ Replace SOLIB_ADD with nothing, not needed?"
 
 BEGIN { doc["SOLIB_CREATE_INFERIOR_HOOK"] = "\
 Replace SOLIB_CREATE_INFERIOR_HOOK with nothing, not needed?"
-    category["SOLIB_CREATE_INFERIOR_HOOK"] = ari_deprecate
+    category["SOLIB_CREATE_INFERIOR_HOOK"] = ari_regression
 }
 /(^|[^_[:alnum:]])SOLIB_CREATE_INFERIOR_HOOK([^_[:alnum:]]|$)/ {
     fail("SOLIB_CREATE_INFERIOR_HOOK")
@@ -807,7 +778,7 @@ Replace PROCESS_LINENUMBER_HOOK with nothing, not needed?"
 
 BEGIN { doc["PC_SOLIB"] = "\
 Replace PC_SOLIB with nothing, not needed?"
-    category["PC_SOLIB"] = ari_deprecate
+    category["PC_SOLIB"] = ari_regression
 }
 /(^|[^_[:alnum:]])PC_SOLIB([^_[:alnum:]]|$)/ {
     fail("PC_SOLIB")
@@ -1051,7 +1022,6 @@ a DECR_PC_AFTER_BREAK"
     category["write_pc"] = ari_deprecate
 }
 /(^|[^_[:alnum:]])write_pc[[:space:]]*\(/ || \
-/(^|[^_[:alnum:]])set_gdbarch_write_pc[[:space:]]*\(/ || \
 /(^|[^_[:alnum:]])TARGET_WRITE_PC[[:space:]]*\(/ {
     fail("write_pc")
 }
@@ -1127,26 +1097,6 @@ Do not use vasprintf(), instead use xstrvprintf"
     fail("vasprintf")
 }
 
-BEGIN { doc["xasprintf"] = "\
-Do not use xasprintf(), instead use xstrprintf"
-    fix("xasprintf", "common/common-utils.h", 1)
-    fix("xasprintf", "common/common-utils.c", 1)
-    category["xasprintf"] = ari_regression
-}
-/(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ {
-    fail("xasprintf")
-}
-
-BEGIN { doc["xvasprintf"] = "\
-Do not use xvasprintf(), instead use xstrvprintf"
-    fix("xvasprintf", "common/common-utils.h", 1)
-    fix("xvasprintf", "common/common-utils.c", 1)
-    category["xvasprintf"] = ari_regression
-}
-/(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ {
-    fail("xvasprintf")
-}
-
 # More generic memory operations
 
 BEGIN { doc["bzero"] = "\
This page took 0.026136 seconds and 4 git commands to generate.