From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7655 invoked by alias); 30 Aug 2015 16:06:41 -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 7639 invoked by uid 89); 30 Aug 2015 16:06:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f181.google.com Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com) (209.85.160.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 30 Aug 2015 16:06:39 +0000 Received: by ykbu129 with SMTP id u129so25453626ykb.2 for ; Sun, 30 Aug 2015 09:06:37 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.93.136 with SMTP id k130mr9460190yka.91.1440950797562; Sun, 30 Aug 2015 09:06:37 -0700 (PDT) Received: by 10.13.254.195 with HTTP; Sun, 30 Aug 2015 09:06:37 -0700 (PDT) In-Reply-To: <20150830100944.GA3916@embecosm.com> References: <20150830100944.GA3916@embecosm.com> Date: Sun, 30 Aug 2015 16:06:00 -0000 Message-ID: Subject: Re: [RFC] Casting NULL pointer From: Doug Evans To: Andrew Burgess Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00862.txt.bz2 On Sun, Aug 30, 2015 at 3:09 AM, Andrew Burgess wrote: > There are a small (~26) number of places where the NULL pointer is > cast list this: > > char *wname = (char *) NULL; > > This compares to a huge number of places (~726) where we don't use a > cast, so: > > const char *name = NULL; > > I've never thought that the cast was either necessary or a > particularly good idea, it feels like unneeded clutter. > > I only ask because I was about to push an obvious change that made a > minor edit to a line containing one of the above casts. I was tempted > to remove the cast, in this case, as a clean up; however, I'm looking > for confirmation that such a change would be viewed as clean up, and > not an unnecessary change. > > As a follow on, given the small number, I'm happy to submit a > patch(es) to remove all of these casts, if its felt that would be a > reasonable clean up. Hi. SGTM