From patchwork Mon Jul 15 16:44:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33692 Received: (qmail 82237 invoked by alias); 15 Jul 2019 16:44:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 82148 invoked by uid 89); 15 Jul 2019 16:44:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Jul 2019 16:44:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A9E80561E0; Mon, 15 Jul 2019 12:44:22 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VOKUDcDMRH2i; Mon, 15 Jul 2019 12:44:22 -0400 (EDT) Received: from murgatroyd.Home (97-122-178-82.hlrn.qwest.net [97.122.178.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 536EA56126; Mon, 15 Jul 2019 12:44:22 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Change ARI to mention C++11, and remove some rules Date: Mon, 15 Jul 2019 10:44:19 -0600 Message-Id: <20190715164419.28484-1-tromey@adacore.com> MIME-Version: 1.0 I noticed that ARI mentions "ISO C 90", but now gdb uses C++11. This patch updates some text to reflect this change. I also noticed that a few rules can be removed now. ARGSUSED doesn't seem to be an issue any more (there's no code mentioning this and I doubt most of us even remember this convention); PARAMS was specific to K&R C; and __func__ is available in C++11. gdb/ChangeLog 2019-07-15 Tom Tromey * contrib/ari/gdb_ari.sh: Mention C++11, not ISO C 90. (ARGSUSED, PARAMS, __func__): Remove rules. --- gdb/ChangeLog | 5 +++++ gdb/contrib/ari/gdb_ari.sh | 42 ++++++-------------------------------- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh index 895654150b3..4bd434c8fec 100755 --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -27,7 +27,7 @@ LC_ALL=C ; export LC_ALL # Permanent checks take the form: -# Do not use XXXX, ISO C 90 implies YYYY +# Do not use XXXX, C++11 implies YYYY # Do not use XXXX, instead use YYYY''. # and should never be removed. @@ -255,17 +255,6 @@ BEGIN { } -# Things in comments - -BEGIN { doc["ARGSUSED"] = "\ -Do not use ARGSUSED, unnecessary" - category["ARGSUSED"] = ari_regression -} -/(^|[^_[:alnum:]])ARGSUSED([^_[:alnum:]]|$)/ { - fail("ARGSUSED") -} - - # SNIP - Strip out comments - SNIP FNR == 1 { @@ -433,27 +422,8 @@ FNR == 1 { cont_p { $0 = full_line $0; cont_p = 0; full_line = ""; } -# GDB uses ISO C 90. Check for any non pure ISO C 90 code - -BEGIN { doc["PARAMS"] = "\ -Do not use PARAMS(), ISO C 90 implies prototypes" - category["PARAMS"] = ari_regression -} -/(^|[^_[:alnum:]])PARAMS([^_[:alnum:]]|$)/ { - fail("PARAMS") -} - -BEGIN { doc["__func__"] = "\ -Do not use __func__, ISO C 90 does not support this macro" - category["__func__"] = ari_regression - fix("__func__", "gdbsupport/gdb_assert.h", 1) -} -/(^|[^_[:alnum:]])__func__([^_[:alnum:]]|$)/ { - fail("__func__") -} - BEGIN { doc["__FUNCTION__"] = "\ -Do not use __FUNCTION__, ISO C 90 does not support this macro" +Do not use __FUNCTION__, C++11 does not support this macro" category["__FUNCTION__"] = ari_regression } /(^|[^_[:alnum:]])__FUNCTION__([^_[:alnum:]]|$)/ { @@ -470,7 +440,7 @@ autoconf tests" } BEGIN { doc["PTR"] = "\ -Do not use PTR, ISO C 90 implies `void *'\''" +Do not use PTR, C++11 implies `void *'\''" category["PTR"] = ari_regression #fix("PTR", "gdb/utils.c", 6) } @@ -816,7 +786,7 @@ unconditionally" } BEGIN { doc["bcmp"] = "\ -Do not use bcmp(), ISO C 90 implies memcmp()" +Do not use bcmp(), C++11 implies memcmp()" category["bcmp"] = ari_regression } /(^|[^_[:alnum:]])bcmp[[:space:]]*\(/ { @@ -824,7 +794,7 @@ Do not use bcmp(), ISO C 90 implies memcmp()" } BEGIN { doc["setlinebuf"] = "\ -Do not use setlinebuf(), ISO C 90 implies setvbuf()" +Do not use setlinebuf(), C++11 implies setvbuf()" category["setlinebuf"] = ari_regression } /(^|[^_[:alnum:]])setlinebuf[[:space:]]*\(/ { @@ -832,7 +802,7 @@ Do not use setlinebuf(), ISO C 90 implies setvbuf()" } BEGIN { doc["bcopy"] = "\ -Do not use bcopy(), ISO C 90 implies memcpy() and memmove()" +Do not use bcopy(), C++11 implies memcpy() and memmove()" category["bcopy"] = ari_regression } /(^|[^_[:alnum:]])bcopy[[:space:]]*\(/ {