X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcontrib%2Fari%2Fgdb_ari.sh;h=895654150b37a833fb43a391478d56da4f4bc66c;hb=268a13a5a3f7c6b9b6ffc5ac2d1b24eb41f3fbdc;hp=8a8cec848463cd5ac987f87f8de4740d6c70b36e;hpb=32d0add0a654c1204ab71dc8a55d9374538c4b33;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh old mode 100644 new mode 100755 index 8a8cec8484..895654150b --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -2,7 +2,7 @@ # GDB script to list of problems using awk. # -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # # This file is part of GDB. # @@ -60,7 +60,7 @@ Options: -Werror Treat all problems as errors. -Wall Report all problems. -Wari Report problems that should be fixed in new code. - -W Report problems in the specifed category. Vaid categories + -W Report problems in the specifed category. Valid categories are: ${all} EOF exit 1 @@ -334,7 +334,7 @@ Do not include gnu-regex.h, instead include gdb_regex.h" BEGIN { doc["wait.h"] = "\ Do not include wait.h or sys/wait.h, instead include gdb_wait.h" - fix("wait.h", "common/gdb_wait.h", 2); + fix("wait.h", "gdbsupport/gdb_wait.h", 2); category["wait.h"] = ari_regression } /^#[[:space:]]*include[[:space:]]*.wait\.h./ \ @@ -446,7 +446,7 @@ Do not use PARAMS(), ISO C 90 implies prototypes" BEGIN { doc["__func__"] = "\ Do not use __func__, ISO C 90 does not support this macro" category["__func__"] = ari_regression - fix("__func__", "common/gdb_assert.h", 1) + fix("__func__", "gdbsupport/gdb_assert.h", 1) } /(^|[^_[:alnum:]])__func__([^_[:alnum:]]|$)/ { fail("__func__") @@ -567,16 +567,6 @@ Function name in first column should be restricted to function implementation" } -# Functions without any parameter should have (void) -# after their name not simply (). -BEGIN { doc["no parameter function"] = "\ -Function having no parameter should be declared with funcname (void)." - category["no parameter function"] = ari_code -} -/^[a-zA-Z][a-z0-9A-Z_]*[[:space:]]*\(\)/ { - fail("no parameter function") -} - BEGIN { doc["hash"] = "\ Do not use ` #...'\'', instead use `#...'\''(some compilers only correctly \ parse a C preprocessor directive when `#'\'' is the first character on \ @@ -603,8 +593,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/gdbsupport/mingw-strerror.c", 1) + fix("strerror", "gdb/gdbsupport/posix-strerror.c", 1) } /(^|[^_[:alnum:]])strerror[[:space:]]*\(/ { fail("strerror") @@ -1090,13 +1080,29 @@ Do not use asprintf(), instead use xstrprintf()" BEGIN { doc["vasprintf"] = "\ Do not use vasprintf(), instead use xstrvprintf" - fix("vasprintf", "common/common-utils.c", 1) + fix("vasprintf", "gdbsupport/common-utils.c", 1) category["vasprintf"] = ari_regression } /(^|[^_[:alnum:]])vasprintf[[:space:]]*\(/ { fail("vasprintf") } +BEGIN { doc["printf_vma"] = "\ +Do not use printf_vma, instead use paddress or phex_nz" + category["printf_vma"] = ari_code +} +/(^|[^_[:alnum:]])printf_vma[[:space:]]*\(/ { + fail("printf_vma") +} + +BEGIN { doc["sprintf_vma"] = "\ +Do not use sprintf_vma, instead use paddress or phex_nz" + category["sprintf_vma"] = ari_code +} +/(^|[^_[:alnum:]])sprintf_vma[[:space:]]*\(/ { + fail("sprintf_vma") +} + # More generic memory operations BEGIN { doc["bzero"] = "\ @@ -1136,7 +1142,7 @@ Do not use strnicmp(), instead use strncasecmp()" # Boolean expressions and conditionals BEGIN { doc["boolean"] = "\ -Do not use `boolean'\'', use `int'\'' instead" +Do not use `boolean'\'', use `bool'\'' instead" category["boolean"] = ari_regression } /(^|[^_[:alnum:]])boolean([^_[:alnum:]]|$)/ { @@ -1145,26 +1151,6 @@ Do not use `boolean'\'', use `int'\'' instead" } } -BEGIN { doc["false"] = "\ -Definitely do not use `false'\'' in boolean expressions" - category["false"] = ari_regression -} -/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ { - if (is_yacc_or_lex == 0) { - fail("false") - } -} - -BEGIN { doc["true"] = "\ -Do not try to use `true'\'' in boolean expressions" - category["true"] = ari_regression -} -/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ { - if (is_yacc_or_lex == 0) { - fail("true") - } -} - # Typedefs that are either redundant or can be reduced to `struct # type *''. # Must be placed before if assignment otherwise ARI exceptions