[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about portability guidelines
From: |
Bruno Haible |
Subject: |
Re: Question about portability guidelines |
Date: |
Mon, 02 Jan 2017 22:17:05 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
Paul Smith wrote:
> > Gnulib code can assume that standard internal types like size_t are no
> > wider than long.
>
> Is that right? On a 64bit system compiling with Microsoft Visual C,
> long is only a 32bit integer. Is it saying that gnulib is specifically
> not intended to work with MS Visual C?
You are right, on 64-bit native Windows (both mingw and MSVC), 'long' is
only 32-bit and thus smaller than 'intptr_t'.
Parts of gnulib do work on MSVC and mingw; for full coverage, there's still
a lot of work to be done [1].
I would vote for removing this sentence "Gnulib code can assume that standard
internal types like size_t are no wider than long." The fix is easy nowadays
(since MSVC now has <stdint.h>): Use intptr_t or ptrdiff_t or size_t as
appropriate.
Bruno
[1] http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00112.html