From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116346 invoked by alias); 30 Aug 2015 12:33:08 -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 116326 invoked by uid 89); 30 Aug 2015 12:33:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 30 Aug 2015 12:33:05 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by sibelius.xs4all.nl (8.14.5/8.14.5) with ESMTP id t7UCX1tu027810; Sun, 30 Aug 2015 14:33:01 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id t7UCX0Nv012040; Sun, 30 Aug 2015 14:33:00 +0200 (CEST) Date: Sun, 30 Aug 2015 12:33:00 -0000 Message-Id: <201508301233.t7UCX0Nv012040@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: andrew.burgess@embecosm.com CC: gdb-patches@sourceware.org In-reply-to: <20150830100944.GA3916@embecosm.com> (message from Andrew Burgess on Sun, 30 Aug 2015 11:09:45 +0100) Subject: Re: [RFC] Casting NULL pointer References: <20150830100944.GA3916@embecosm.com> X-SW-Source: 2015-08/txt/msg00859.txt.bz2 > Date: Sun, 30 Aug 2015 11:09:45 +0100 > From: Andrew Burgess > > 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. The cast isn't necessary in assignments like that. However it is still necessary to cast NULL to an appropriate pointer when passing it as an argument to a varargs function.