From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24812 invoked by alias); 10 Apr 2003 17:45:49 -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 24803 invoked from network); 10 Apr 2003 17:45:49 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 10 Apr 2003 17:45:49 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6820D2B2F; Thu, 10 Apr 2003 13:45:34 -0400 (EDT) Message-ID: <3E95ADBE.7000500@redhat.com> Date: Thu, 10 Apr 2003 17:45:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andreas Schwab Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/TESTSUITE] build schedlock.c on 64-bit platforms 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00206.txt.bz2 > 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) :-)