From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19199 invoked by alias); 5 Jul 2005 04:23:09 -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 19177 invoked by uid 22791); 5 Jul 2005 04:23:02 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 05 Jul 2005 04:23:02 +0000 Received: from drow by nevyn.them.org with local (Exim 4.51) id 1DpexV-0001i3-H1 for gdb-patches@sourceware.org; Tue, 05 Jul 2005 00:22:57 -0400 Date: Tue, 05 Jul 2005 04:23:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [commit] Properly cast sentinels for concat() Message-ID: <20050705042256.GA6548@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <200507041336.j64Da5cE001221@jop31.nfra.nl> <20050704225153.GA31424@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00058.txt.bz2 On Tue, Jul 05, 2005 at 06:34:18AM +0200, Eli Zaretskii wrote: > > Date: Mon, 4 Jul 2005 18:51:53 -0400 > > From: Daniel Jacobowitz > > Cc: Mark Kettenis , gdb-patches@sourceware.org > > > > You must cast NULL to a pointer type if you use it as the sentinel in a > > varargs list, in portable code, because 0 is a legal definition of NULL > > (according to the C standard, which is quite clear on the subject). On > > an I32 LP64 system, passing 0 to a varargs function may take 32 bits on > > the stack while passing NULL takes 64 bits. > > But in Mark's case, NULL is defined as (void *)0, so it's a pointer, > not an int. No, OpenBSD uses 0 rather than (void *) 0. As the language allows. -- Daniel Jacobowitz CodeSourcery, LLC