From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23738 invoked by alias); 3 Jan 2003 00:43:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23727 invoked from network); 3 Jan 2003 00:43:03 -0000 Received: from unknown (HELO smtp04.iprimus.com.au) (210.50.76.52) by 209.249.29.67 with SMTP; 3 Jan 2003 00:43:03 -0000 Received: from smtp02.iprimus.net.au (210.50.76.70) by smtp04.iprimus.com.au (6.7.010) id 3DF583C30024270E for gcc@gcc.gnu.org; Fri, 3 Jan 2003 11:42:51 +1100 Received: from localhost.iprimus.com.au ([203.134.93.141]) by smtp02.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Fri, 3 Jan 2003 11:42:50 +1100 Message-Id: <5.1.0.14.0.20030103114012.009fe840@pop.iprimus.com.au> X-Sender: jamesbuch@pop.iprimus.com.au Date: Fri, 03 Jan 2003 00:43:00 -0000 To: "Joseph D. Wagner" , From: James Buchanan Subject: RE: Generated unique labels In-Reply-To: <004301c2b232$6c286210$578a3841@joe> References: <5.1.0.14.0.20021230031449.009ec6a0@pop.iprimus.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-OriginalArrivalTime: 03 Jan 2003 00:42:51.0174 (UTC) FILETIME=[0B88C460:01C2B2C1] X-SW-Source: 2003-01/txt/msg00081.txt.bz2 I prefer this option that Joseph has given, if possible. Using assembler local labels means different labels for different types of assembler, doesn't it? A platform independent label generator is probably best. Then again, I don't really know, or understand what exactly the requirements of these labels are. At 01:41 AM 1/2/2003 -0600, Joseph D. Wagner wrote: >I don't know if this will work or not, but it's worth a shot. > >Uses C++ > >Joseph Wagner > >-----Original Message----- >From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf Of >James Buchanan >Sent: Sunday, December 29, 2002 10:32 AM >To: gcc@gcc.gnu.org >Subject: Generated unique labels > >In the Projects file: > >=== >Generated unique labels. Have some way of generating distinct >labels for use in extended asm statements. I don't know what a >good syntax would be. >=== > >Has this been done yet? If not has anyone been assigned to it? > >Where would this be done? What is an extended asm statement, >is this asm code generated by the back end? Is there any >distinction between asm and extended asm? So things peculiar >to local labels can't be used? > >Would this be a function, let's say: > >...in file uniquelabel.h > >char * >gen_unique_label(); > >...in file uniquelabel.c >char * >gen_unique_label() >{ > /* Get some memory or just return a pointer?? */ > char *the_label = (char *)safe_malloc(); > > /* > Let's say we only use a static char array > and return a pointer to it. The caller gets it > and copies the string straight away, but > this seems silly. Functions should take > care of it. > */ > > /* > Or perhaps allocate a string, the caller > can do free(the_label) > */ > > /* do stuff */ > return (the_label); >} > >? > >