delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/04/06/02:05:23

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=UtIWjrscs4fOxQPbQlkqhYs+m2sop
tIGmXfZ9V9sfrZI293zUvjLuFUyiybqCgk93juqg2tcEwQ/Peluq8k0LoPZdWqL6
VhCs3A0fWZZAo8M+sxLtxM0OPdiffwxdda0TzEs7zYRFfHrNo2fdfjb0lbrrIU4D
etDpZKOlIvCeuE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; s=default; bh=cXrw5g58nHAzUnneM77DuR5DkWw=; b=dAO
/I/PbLL8Ug1SlddBV82C75QxoTupXRrrpsoWjZF6z33bff+Md7MWxJ1lUvxhFC+D
QVA4L0cIof2kq4PO+3PEYXL3KIuu1BsKA1KYh6XPfGKUZreZts4vmP0VulsuPMBZ
0qLgj7wDWXgAqIAj/40Dx4JNgGuxxPItg5bEcVS4=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-lb0-f193.google.com
MIME-Version: 1.0
X-Received: by 10.152.19.65 with SMTP id c1mr87317lae.35.1396764295651; Sat, 05 Apr 2014 23:04:55 -0700 (PDT)
Date: Sat, 5 Apr 2014 23:04:55 -0700
Message-ID: <CABKp57PdLMKqmGFhfMEN4BLPFcndkpibora5yx2Xdy6zh4+WzA@mail.gmail.com>
Subject: long_int vs int byte sizes
From: Joseph Maxwell <discard36 AT gmail DOT com>
To: cygwin AT cygwin DOT com

Not sure if this is hardware, software or compiler dependent


$ uname -a
CYGWIN_NT-5.1 machinename 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin

On a 32 bit XP SP 3 platform

wrote a small profram to check some parameters;
Received the following Re: Signed abd unsigned iintegers

[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.

So wrote another for byte sizes and got the following -

[quote]
The  size of short int is 2 bytes
The  size of int is 4 bytes
The  size of long int is 4 bytes
The  size of double is 8 bytes
The  size of long double is 12 bytes
[/quote]

Note size of int and long int are the same both are 4 bytes long

Is this to be expected?

Thanks!

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

- Raw text -


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