🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49517

Re: passing constants by pointer

#49517
From: Dean Herington
Date: Thu, 20 Jan 1994 15:06
22 lines
1584 bytes
In article <rbp-190194215745@tonto-slip5.cis.brown.edu> rbp@brown.edu (bob pasker) writes:

   i have created the following workaround:

   #define BYREF(c) ({int _bar=c; &_bar;})

		   foo(BYREF(1));

   :-(

   luckily GNU cc allows these kind of "statements within expressions."

Yes, "statements within expressions" are supported, but in your
example above aren't you passing to foo the address of a local
variable that has already expired?  I doubt this is guaranteed to
work.

--
Dean Herington			internet: hering@dg-rtp.dg.com
Data General Corporation	    uucp: ...!uunet!dg-rtp!hering
62 Alexander Drive		   voice: 919-248-6120
Research Triangle Park, NC 27709     fax: 919-248-6353
Technical Details
Message-ID: <HERING.94Jan20100654@deneb.rtp.dg.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!news.intercon.com!udel!news.sprintlink.net!dg-rtp!dg-rtp!hering
References: <rbp-190194182522@tonto-slip13.cis.brown.edu> <rbp-190194215745@tonto-slip5.cis.brown.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,74f900c98fe29e8b
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-01-20 13:18:38 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!news.intercon.com!udel!news.sprintlink.net!dg-rtp!dg-rtp!hering
From: hering@rtp.dg.com (Dean Herington)
Subject: Re: passing constants by pointer
Sender: usenet@dg-rtp.dg.com (Usenet Administration)
Message-ID: <HERING.94Jan20100654@deneb.rtp.dg.com>
In-Reply-To: rbp@brown.edu's message of Wed, 19 Jan 1994 21:57:45 -0500
Date: 20 Jan 1994 15:06:45 GMT
To: rbp@brown.edu (bob pasker)
Lines: 22
References: <rbp-190194182522@tonto-slip13.cis.brown.edu>
 <rbp-190194215745@tonto-slip5.cis.brown.edu>
Organization: Unix Software Development, Data General Corp., RTP, NC
Followup-To: gnu.gcc.help
Lines: 22