• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Odd gcc error passing reference parameter to function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd gcc error passing reference parameter to function


  • Subject: Re: Odd gcc error passing reference parameter to function
  • From: Jerry <email@hidden>
  • Date: Fri, 11 Mar 2005 08:54:37 +0000


On 10 Mar 2005, at 21:23, John Weeks wrote:

I have just started using Xcode. My first project is developing a plug-in
for my company's main product. I thought that would be a good way to
introduce myself to Xcode.


I have encountered a compile error that seems to me to be bogus and I was
wondering if anyone can shed light on it. I define a function with this
prototype:


int ExtractAnalogChannelInfo(string::iterator &currentC, string::iterator
&theEnd, const string &termchars, long &channelNum, long &ctype, double
&Vmin, double &Vmax, int &termchar);


This results in the error:

error: in passing argument 2 of `int
ScanParse::ExtractAnalogChannelInfo(__gnu_cxx::__normal_iterator<char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >&, const std::string&, long
int&, long int&, double&, double&, int&)'


If I change the second parameter to pass-by-value instead of a reference,
it compiles.


VC++.net compiles the unchanged statement OK, and the first reference
compilesin Xcode, so it's not some obscure characteristic of
string::iterator (or is it?).

Xcode: 1.5 IDE: 389.0 Core: 387.0 ToolSupport: 372.0
Running on OS X 10.3.7

How do I found out the version of gcc on my machine?

Thanks for any help with this.

Are you passing in an expression as the parameter? VC++.net lets you take the reference of a temporary but GCC and CW don't.


Jerry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Odd gcc error passing reference parameter to function (From: John Weeks <email@hidden>)

  • Prev by Date: Re: NULL characters?
  • Next by Date: Re: Debugger and STL
  • Previous by thread: Odd gcc error passing reference parameter to function
  • Next by thread: Re: Odd gcc error passing reference parameter to function
  • Index(es):
    • Date
    • Thread