From patchwork Mon Mar 2 14:10:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 5413 Received: (qmail 58821 invoked by alias); 2 Mar 2015 14:10:42 -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 58811 invoked by uid 89); 2 Mar 2015 14:10:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Mon, 02 Mar 2015 14:10:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E5646D322C; Mon, 2 Mar 2015 09:10:37 -0500 (EST) 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 GINy2Hh2oOUa; Mon, 2 Mar 2015 09:10:37 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BA6DAD322B; Mon, 2 Mar 2015 09:10:37 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 49C2A40EAD; Mon, 2 Mar 2015 06:10:37 -0800 (PST) Date: Mon, 2 Mar 2015 06:10:37 -0800 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org, Mark Wielaard Subject: Re: [RFA/commit] Remove use of stdbool.h in GDB sources. Message-ID: <20150302141037.GA4449@adacore.com> References: <1425027226-23546-1-git-send-email-brobecker@adacore.com> <54F03DD8.8080902@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54F03DD8.8080902@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) > > gdb/ChangeLog: > > > > * utils.h: Remove #include. > > (producer_is_gcc): Change return type to "int". > > * utils.c (producer_is_gcc): Change return type to int. > > Return 1 instead of true, and 0 instead of false. > > Adjust function documentation accordingly. > > > > I will push this patch in the next few days, unless there are > > objections. > > No objections here. Thanks, Pedro. I just pushed the patch. > (guess we should reinstate the ARI bool rule too then.) Absolutely. Attached is the patch that I just pushed reinstating them. gdb/ChangeLog: * contrib/ari/gdb_ari.sh: Reinstate checks for "true" and "false". From 00e474c2e96f9a56f128ee29fbdc36ac32d5e14a Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Mon, 2 Mar 2015 06:05:01 -0800 Subject: [PATCH] Revert "Remove true and false ARI checks now that we use stdbool.h." As we cannot use type bool until conversion to C++ is official, this patch re-instates the ARI checks for "true/false". gdb/ChangeLog: * contrib/ari/gdb_ari.sh: Reinstate checks for "true" and "false". --- gdb/ChangeLog | 4 ++++ gdb/contrib/ari/gdb_ari.sh | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 56e7206..922b1d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2015-03-02 Joel Brobecker + * contrib/ari/gdb_ari.sh: Reinstate checks for "true" and "false". + +2015-03-02 Joel Brobecker + * utils.h: Remove #include. (producer_is_gcc): Change return type to "int". * utils.c (producer_is_gcc): Change return type to int. diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh index 52d8ab1..b868a17 100644 --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -1145,6 +1145,26 @@ 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 -- 1.9.1