delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/31/06:40:51

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
X-Trace: 100377555/mk-filter-2.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/79.66.2.206/None/johne53 AT tiscali DOT co DOT uk
X-SBRS: None
X-RemoteIP: 79.66.2.206
X-IP-MAIL-FROM: johne53 AT tiscali DOT co DOT uk
X-MUA: Microsoft Outlook Express 6.00.2900.2180Produced By Microsoft MimeOLE V6.00.2900.2180
X-IP-BHB: Once
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AqwEAPeKCklPQgLO/2dsb2JhbACEG1XIWYNR
X-IronPort-AV: E=Sophos;i="4.33,522,1220223600"; d="scan'208";a="100377555"
Message-ID: <001a01c93b4d$617de150$4001a8c0@mycomputer>
From: "John Emmas" <johne53 AT tiscali DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
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> <490AE8A0 DOT 8090009 AT sh DOT cvut DOT cz>
Subject: Re: cygwin g++ strictness
Date: Fri, 31 Oct 2008 11:39:48 -0000
MIME-Version: 1.0
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

----- Original Message ----- 
From: "Václav Haisman"
Sent: 31 October 2008 11:14
Subject: Re: cygwin g++ strictness
>
> 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.

Thanks Vaclav.  It must be something like that because I've noticed that if
the function prototype is changed to look like this:-

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

this works.....
gint x = 4;
gint y = 5;
int z = AddTwoInts (x, y);

wheareas this doesn't.....
int32_t x = 4;
int32_t y = 5;
int z = AddTwoInts (x, y);

So, even though it looks like 'sys/types.h' is typedefing int32_t as an int,
that section must either be getting conditionally (not) compiled or maybe
int32_t is getting redefined somewhere else.

Having said all that, most compilers provide implicit conversions between
related types.  gcc4.4 seems to be doing that and I'm pretty sure that MSVC
would allow it also (although I haven't tried it).

Thanks also for the suggestion about changing to temporary variables but it
won't help in this case because this isn't my own code and I'd probably need
to change dozens of modules.  Explicit casting is probably the safest
solution.

John 


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019