X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <490AE8A0.8090009@sh.cvut.cz> Date: Fri, 31 Oct 2008 12:14:40 +0100 From: =?windows-1252?Q?V=E1clav_Haisman?= User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: cygwin g++ strictness References: <000201c93ac7$38265930$4001a8c0 AT mycomputer> <490A30C8 DOT 5000107 AT sh DOT cvut DOT cz> <001601c93b31$a961b940$4001a8c0 AT mycomputer> <003e01c93b42$e92a17a0$4001a8c0 AT mycomputer> In-Reply-To: <003e01c93b42$e92a17a0$4001a8c0@mycomputer> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 John Emmas wrote: > ----- Original Message ----- From: "John Emmas" > Sent: 31 October 2008 08:21 > Subject: Re: cygwin g++ strictness >> >> adding the compiler flag -fpermissive seems to have solved the problem. >> > > > ----- Original Message ----- From: "Václav Haisman" > Sent: 31 October 2008 10:07 > Subject: Re: cygwin g++ strictness >> >> It just works. You are doing something wrong. There is nothing wrong >> with GCC 3.4 in this respect. >> > > It seems like I spoke to soon..... -fpermissive seems to have helped in > some cases but not in every case. I'll give an example. Please can someone > tell me if I'm misunderstanding something here. Consider the following > function prototype (where 'gint' is typedef'd as an int in gtypes.h):- > > #include > int AddTwoInts (gint& a, gint& b); > > This code compiles under both Linux/gcc4.4 and also under Cygwin:- > gint x = 4; > gint y = 5; > int z = AddTwoInts (x, y); > > This code compiles under Linux/gcc4.4 but not under Cygwin:- > #include // typedefs int32_t as int > int32_t x = 4; > int32_t y = 5; > int z = AddTwoInts (x, y); Check what type is gint really is. I suspect the gint will be typedef for long. Long and int are two different types even though they are both 32bits wide on 32bit platforms. Either declare x, y as gint or use temporaries for the AddTwoInts() call. > > The last example produces this error on my system:- > error: no matching function for call to `AddTwoInts(int32_t&, int32_t&)' > note: candidates are: int AddTwoInts(gint&, gint&) [...] - -- VH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iFYEAREIAAYFAkkK6KAACgkQhQBMvHf/WHnLpwDeMNkb5Gf8KL5fkj1kGbYA94LM cKMQbaW5jHxZXQDfRoB6wH03WYo8tliLcgpH2ceZ9gkGvy2YtbhbDg== =KUkg -----END PGP SIGNATURE----- -- 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/