public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Michael Enright <mike@kmcardiff.com>
To: cygwin@cygwin.com
Subject: Re: [Cygwin-ports-general] Ncview
Date: Thu, 01 Oct 2015 22:11:00 -0000	[thread overview]
Message-ID: <CAOC2fq_vWAMCYjmaW1VH5bkAhrUB810X3Dqnjf9nX0Y5_vwoew@mail.gmail.com> (raw)
In-Reply-To: <1443720905.8588.17.camel@cygwin.com>

On Thu, Oct 1, 2015 at 10:35 AM, Yaakov Selkowitz <yselkowitz@cygwin.com> wrote:
>
> Confirmed.  Often 64-bit-only issues come down to one or more of the
> following:
>
> * implicit function declarations.  Per the C standard, argument types
> are assumed to match whatever is given (which may be wrong if e.g. 0 is
> used instead of 0L or (PointerType)0 or NULL etc.) and the return type
> is assumed to be int (which will truncate the actual return value when
> it is actually a long/pointer).
>
> * vararg types.  Because these types aren't declared, the compiler can't
> automatically cast values to the correct type, so literal values and
> symbolic constants must be explicitly cast if they are not meant to be
> an int and are not obviously a long/pointer.
>

Good list. I would also add attempting to store pointer differences in
an "int" instead of ptrdiff_t and the issue you can see from
https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models,
which is that the integer types other than long long on 64-bit Windows
are 32-bits while on 64-bit Linux 'long' and 'long long' are both
64-bit. This issue means that 'long' is a good-enough hack for
ptrdiff_t on 64-bit Linux but not 64-bit Windows. Does Cygwin differ
from Windows itself on this issue? Most 32-bit-designed code is
probably more sensitive to the pointer-difference aspect of this.

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

      parent reply	other threads:[~2015-10-01 22:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKmU=T_XtcOf1MOa_31oTfNYzUZ6QZD1xU9eTG-ERkvsua+gZQ@mail.gmail.com>
2015-09-28 15:33 ` Marco Atzeri
2015-10-01 17:35   ` Yaakov Selkowitz
2015-10-01 21:35     ` Marco Atzeri
2015-10-02  8:58       ` Yaakov Selkowitz
2015-10-02 13:10         ` Marco Atzeri
2015-10-01 22:11     ` Michael Enright [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOC2fq_vWAMCYjmaW1VH5bkAhrUB810X3Dqnjf9nX0Y5_vwoew@mail.gmail.com \
    --to=mike@kmcardiff.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).