cygwin g++ strictness

John Emmas johne53@tiscali.co.uk
Fri Oct 31 12:22:00 GMT 2008


----- Original Message ----- 
From: "Václav Haisman"
Sent: 31 October 2008 11:54
Subject: Re: cygwin g++ strictness
>
> That has nothing to do with your problem. Reference to int and reference
> to long are two totally unrelated types. The implicit conversions of
> C/C++ only apply to values, not references.
>
Ah, fair enough, I'd never thought about it but it's obvious now you've 
mentioned it.


>
> No, casting is not an option, really. You have references. What do you
> intend to cast x and y to?
>
Maybe it's a happy accident but this seems to compile and link (and work)

int AddTwoInts (int& a, int& b);

int32_t x = 4;
int32_t y = 5;
int z = AddTwoInts ((int&)x, (int&)y);  // Compiles, links and works
int zz = AddTwoInts (x, y);  // Doesn't compile


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list