From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27674 invoked by alias); 10 Apr 2003 17:48:51 -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 27664 invoked from network); 10 Apr 2003 17:48:50 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 10 Apr 2003 17:48:50 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 193gAO-0003Zz-00; Thu, 10 Apr 2003 12:48:53 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 193gAG-0003t7-00; Thu, 10 Apr 2003 13:48:44 -0400 Date: Thu, 10 Apr 2003 17:48:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Andreas Schwab , Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/TESTSUITE] build schedlock.c on 64-bit platforms Message-ID: <20030410174844.GA14930@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Andreas Schwab , Elena Zannoni , gdb-patches@sources.redhat.com References: <16019.15635.929065.664152@localhost.redhat.com> <20030409131329.GA4525@nevyn.them.org> <16021.31692.763468.4182@localhost.redhat.com> <20030410141953.GA10379@nevyn.them.org> <3E958136.3060102@redhat.com> <20030410152038.GA11800@nevyn.them.org> <3E95ADBE.7000500@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E95ADBE.7000500@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00207.txt.bz2 On Thu, Apr 10, 2003 at 01:45:34PM -0400, Andrew Cagney wrote: > >Daniel Jacobowitz writes: > > > >|> On Thu, Apr 10, 2003 at 05:16:05PM +0200, Andreas Schwab wrote: > >|> > Andrew Cagney writes: > >|> > > >|> > |> > args[i] = 1; > >|> > |> >> - res = pthread_create(&threads[i], NULL, thread_function, > >(void *)i); > >|> > |> >> > >|> > |> > >|> > |> Try: > >|> > |> > >|> > |> (((char *) NULL) + i) > >|> > |> > >|> > |> and what ever the reverse of that is .... > >|> > > >|> > That is even less portable than the above. > >|> > >|> Really? What's non-portable about it? > > > >NULL is not an object, and the C standard does not define any meaning for > >the above expression. On the other hand, the effect of a cast from > >integer to pointer is implementation-defined (although it might trap). > > What about this then: > > static char *null_char_pointer = NULL; > > (null_char_pointer + i) > > and: > > (i - null_char_pointer) > > :-) Also not defined, for the same reason. I believe the only pointer outside of an object that's guaranteed to have any useful value is the one which points just past the end of it. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer