Article View: gnu.gcc.help
Article #49511passing constants by pointer
From: bob pasker
Date: Thu, 20 Jan 1994 02:25
Date: Thu, 20 Jan 1994 02:25
20 lines
1305 bytes
1305 bytes
my VAX C compiler allows me to pass a constant by reference as follows:
foo(&1)
but GCC gives me an "invalid lvalue".
does anyone know the proper incantation?
[i understand the inherent stupidity in this, but some VMS library routines
want integers by ref, even though they are not going to be modified by the
caller. i'm porting a whole bunch of code, and doing bar = 1; foo(&bar)
would be quite tedious.]
many thanks.
--
-- bob pasker
-- brown u., dept. of history
-- rbp@brown.edu
--
Technical Details
Message-ID:
<rbp-190194182522@tonto-slip13.cis.brown.edu>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!rz.uni-karlsruhe.de!news.uni-ulm.de!news.belwue.de!surz03.hrz.Uni-Marburg.DE!news.th-darmstadt.de!math.fu-berlin.de!zrz.TU-Berlin.DE!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!agate!news.Brown.EDU!tonto-slip13.cis.brown.edu!userShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,74f900c98fe29e8b,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1994-01-20 03:56:40 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!rz.uni-karlsruhe.de!news.uni-ulm.de!news.belwue.de!surz03.hrz.Uni-Marburg.DE!news.th-darmstadt.de!math.fu-berlin.de!zrz.TU-Berlin.DE!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!agate!news.Brown.EDU!tonto-slip13.cis.brown.edu!user From: rbp@brown.edu (bob pasker) Newsgroups: gnu.gcc.help Subject: passing constants by pointer Followup-To: gnu.gcc.help Date: Wed, 19 Jan 1994 18:25:22 -0800 Organization: dept. of history, brown university Lines: 20 Message-ID: <rbp-190194182522@tonto-slip13.cis.brown.edu> NNTP-Posting-Host: tonto-slip13.cis.brown.edu