From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4742 invoked by alias); 6 Apr 2014 06:36:29 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 4731 invoked by uid 89); 6 Apr 2014 06:36:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail110.syd.optusnet.com.au Received: from mail110.syd.optusnet.com.au (HELO mail110.syd.optusnet.com.au) (211.29.132.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Apr 2014 06:36:26 +0000 Received: from OwnerPC311012 (unknown [203.202.164.190]) (Authenticated sender: sisyphus1@optusnet.com.au) by mail110.syd.optusnet.com.au (Postfix) with ESMTPA id 4B89378325F; Sun, 6 Apr 2014 16:36:17 +1000 (EST) Message-ID: <6BA0E670DE2A4416BB5A12250B427E5A@OwnerPC311012> From: To: "Joseph Maxwell" , References: In-Reply-To: Subject: Re: long_int vs int byte sizes Date: Sun, 06 Apr 2014 06:36:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=8e8rgZJuizJfF74+JHJpGg==:117 a=8e8rgZJuizJfF74+JHJpGg==:17 a=PO7r1zJSAAAA:8 a=52oLloMokugA:10 a=8nJEP1OIZ-IA:10 a=u8qkCuwD83Q3mJpxJIMA:9 a=wPNLvfGTeEIA:10 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00069.txt.bz2 -----Original Message----- From: Joseph Maxwell > [quote] > int x = 0xAB78 in decimal format is : 43896 > and > unsigned int y = 0xAB78 in decimal format is : 43896 > The size of int is 4 bytes > [/quote] > > Not quite what I expected, sine the leftmost bit in 'int' is 1 and > would be the negative flag. No - the full 32-bit representation of 0xAB78 is: 0000 0000 0000 0000 1010 1011 0111 1000 The leftmost bit is zero. > Note size of int and long int are the same both are 4 bytes long > > Is this to be expected? I think so. I've not yet struck a case on Windows where either int or long are not 4 bytes. (Haven't tried Cygwin64.) Certainly, on some other systems, int is 4 bytes and long is 8 bytes. The standards permit both configurations. Cheers, Rob -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple