From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95022 invoked by alias); 13 Oct 2016 17:28:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 94904 invoked by uid 89); 13 Oct 2016 17:28:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Administrator, 2311, 23,11, 1,10 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Oct 2016 17:27:55 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C7C281129; Thu, 13 Oct 2016 17:27:54 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9DHRr78012790; Thu, 13 Oct 2016 13:27:53 -0400 Subject: [ob/pushed] ARI: Remove true/false checks (Re: New ARI warning Thu Oct 13 01:55:56 UTC 2016) To: GDB Administrator , gdb-patches@sourceware.org References: <20161013015556.GA6730@sourceware.org> From: Pedro Alves Message-ID: <99949fd7-df8a-6fc4-c685-fe38df7879ee@redhat.com> Date: Thu, 13 Oct 2016 17:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20161013015556.GA6730@sourceware.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00383.txt.bz2 On 10/13/2016 02:55 AM, GDB Administrator wrote: > 33a34,35 >> gdb/breakpoint.c:14787: regression: false: Definitely do not use 'false' in boolean expressions > gdb/breakpoint.c:14787: bool match = false; >> gdb/breakpoint.c:14799: regression: true: Do not try to use 'true' in boolean expressions > gdb/breakpoint.c:14799: match = true; > 57a60,64 >> gdb/cli/cli-utils.c:134: regression: false: Definitely do not use 'false' in boolean expressions > gdb/cli/cli-utils.c:134: m_finished = false; >> gdb/cli/cli-utils.c:139: regression: false: Definitely do not use 'false' in boolean expressions > gdb/cli/cli-utils.c:139: m_in_range = false; >> gdb/cli/cli-utils.c:158: regression: false: Definitely do not use 'false' in boolean expressions > gdb/cli/cli-utils.c:158: m_in_range = false; >> gdb/cli/cli-utils.c:189: regression: true: Do not try to use 'true' in boolean expressions > gdb/cli/cli-utils.c:189: m_in_range = true; >> gdb/cli/cli-utils.c:206: regression: true: Do not try to use 'true' in boolean expressions > gdb/cli/cli-utils.c:206: m_in_range = true; > 592a600,604 >> gdb/tid-parse.c:130: regression: false: Definitely do not use 'false' in boolean expressions > gdb/tid-parse.c:130: m_qualified = false; >> gdb/tid-parse.c:214: regression: true: Do not try to use 'true' in boolean expressions > gdb/tid-parse.c:214: m_qualified = true; >> gdb/tid-parse.c:218: regression: false: Definitely do not use 'false' in boolean expressions > gdb/tid-parse.c:218: return false; >> gdb/tid-parse.c:223: regression: false: Definitely do not use 'false' in boolean expressions > gdb/tid-parse.c:223: m_qualified = false; >> gdb/tid-parse.c:246: regression: false: Definitely do not use 'false' in boolean expressions > gdb/tid-parse.c:246: return false; > I pushed the ARI patch below as obvious. Results in: $ diff -up ari.before ari.after --- ari.before 2016-10-13 18:14:38.290291424 +0100 +++ ari.after 2016-10-13 18:19:39.354312583 +0100 @@ -1,10 +1,3 @@ -./breakpoint.c:14787: regression: Definitely do not use `false' in boolean expressions -./breakpoint.c:14799: regression: Do not try to use `true' in boolean expressions -./cli/cli-utils.c:134: regression: Definitely do not use `false' in boolean expressions -./cli/cli-utils.c:139: regression: Definitely do not use `false' in boolean expressions -./cli/cli-utils.c:158: regression: Definitely do not use `false' in boolean expressions -./cli/cli-utils.c:189: regression: Do not try to use `true' in boolean expressions -./cli/cli-utils.c:206: regression: Do not try to use `true' in boolean expressions ./command.h:64: regression: Replace var_boolean with add_setshow_boolean_cmd ./common/agent.c:152: regression: Do not use strerror(), instead use safe_strerror() ./common/agent.c:171: regression: Do not use strerror(), instead use safe_strerror() @@ -23,11 +16,6 @@ ./python/py-unwind.c:502: regression: Do not use __FUNCTION__, ISO C 90 does not support this macro ./python/py-unwind.c:526: regression: Do not use __FUNCTION__, ISO C 90 does not support this macro ./python/py-unwind.c:614: regression: Do not use __FUNCTION__, ISO C 90 does not support this macro -./tid-parse.c:130: regression: Definitely do not use `false' in boolean expressions -./tid-parse.c:214: regression: Do not try to use `true' in boolean expressions -./tid-parse.c:218: regression: Definitely do not use `false' in boolean expressions -./tid-parse.c:223: regression: Definitely do not use `false' in boolean expressions -./tid-parse.c:246: regression: Definitely do not use `false' in boolean expressions ./utils.c:528: regression: Do not use abort, instead use internal_error; GDB should never abort ./utils.c:542: regression: Do not use abort, instead use internal_error; GDB should never abort ./utils.c:662: regression: Do not use abort, instead use internal_error; GDB should never abort [PATCH] ARI: Remove true/false checks These don't make sense with C++. gdb/ChangeLog: 2016-10-13 Pedro Alves * contrib/ari/gdb_ari.sh (boolean): Suggest bool instead. (false, true): Remove checks. --- gdb/ChangeLog | 5 +++++ gdb/contrib/ari/gdb_ari.sh | 22 +--------------------- 2 files changed, 6 insertions(+), 21 deletions(-) mode change 100644 => 100755 gdb/contrib/ari/gdb_ari.sh diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0efe9c1..57fdc64 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-10-13 Pedro Alves + + * contrib/ari/gdb_ari.sh (boolean): Suggest bool instead. + (false, true): Remove checks. + 2016-10-12 Tom Tromey * machoread.c (macho_symfile_read_all_oso): Use std::string. diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh old mode 100644 new mode 100755 index 43f0206..7e639e3 --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -1136,7 +1136,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 +1145,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 -- 2.5.5