From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22053 invoked by alias); 5 Jul 2005 07:36:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22019 invoked by uid 22791); 5 Jul 2005 07:36:02 -0000 Received: from server7.nfra.nl (HELO server7.nfra.nl) (192.87.1.57) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 05 Jul 2005 07:36:02 +0000 Received: from jop31.nfra.nl [10.87.10.31] by server7.nfra.nl; Tue, 05 Jul 2005 09:36:11 +0200 Received: from jop31.nfra.nl (localhost [127.0.0.1]) by jop31.nfra.nl (8.13.1/8.12.7/SuSE Linux 0.6) with ESMTP id j657ZvOD005227; Tue, 5 Jul 2005 09:35:57 +0200 Received: (from kettenis@localhost) by jop31.nfra.nl (8.13.1/8.13.1/Submit) id j657ZvRk005224; Tue, 5 Jul 2005 09:35:57 +0200 Date: Tue, 05 Jul 2005 07:36:00 -0000 Message-Id: <200507050735.j657ZvRk005224@jop31.nfra.nl> From: Mark Kettenis To: eliz@gnu.org CC: gdb-patches@sourceware.org In-reply-to: (message from Eli Zaretskii on Tue, 05 Jul 2005 01:08:22 +0200) Subject: Re: [commit] Properly cast sentinels for concat() References: <200507041336.j64Da5cE001221@jop31.nfra.nl> X-SW-Source: 2005-07/txt/msg00060.txt.bz2 Date: Tue, 05 Jul 2005 01:08:22 +0200 From: Eli Zaretskii CC: gdb-patches@sourceware.org Reply-to: Eli Zaretskii > Date: Mon, 4 Jul 2005 15:36:05 +0200 > From: Mark Kettenis > > This fixes a few warnings with GCC 4.0 on OpenBSD. You'll probably > won't see them on other systems, since they only show up if NULL is > defined as an integer instead of a pointer constant (both are valid > according to C standard). The stddef.h that comes with GCC defines > NULL as (void *)NULL, but we don't use that one on OpenBSD. > > Anyway, I committed the attached patch as obvious. Actually, it's not at all obvious, Apparently not :(. it's IMNSHO simply wrong. Casting NULL to _anything_ should never be needed, unless NULL is abused (i.e. used in a place where a pointer cannot be). Let's not decide that a patch is ``obvious'' just because it happens to shut up the compiler! Unfortuntaly, as Daniel excellently explained, this isn't just to shut up the compiler. In this case, I'd say it's a bug in OpenBSD (it _should_ use stddef.h that comes with GCC when a program is compiled with GCC), coupled with the silly attitude of latest GCC versions to whine about more and more perfectly valid C code constructs. Let's not argue about these points. There are arguments for both sides here. But the fact is that OpenBSD does provide it's own stddef.h, so we have to deal with it. Mark