From mboxrd@z Thu Jan 1 00:00:00 1970 From: raeburn at raeburn.org (Ken Raeburn) Date: Sun, 4 May 2008 11:13:30 -0400 Subject: Best practice in C to support 64-bit or 32-bit address length with same source file ? In-Reply-To: <481CEF2F.70206@hp.com> References: <481CEF2F.70206@hp.com> Message-ID: <7BCD3C6D-904D-457A-BD75-2A690931DFF2@raeburn.org> On May 3, 2008, at 19:03, Jay Estabrook wrote: > Modern C on most machines now establishes: > > sizeof(long integer) == sizeof(pointer) > > so if you MUST live with a program in which is is common to go > back and forth between something declared "int" and a pointer, > changing the variable declared "int" to "long" often will do the > trick. Not all systems do that, though. On 64-bit Windows, for example, sizeof(int)==sizeof(long)