Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: 64 bit architectures and C/C++ Message-ID: <16069@smoke.brl.mil> Date: 6 May 91 20:42:23 GMT References: <1991May4.202438.14664@ux1.cso.uiuc.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 14 In article <1991May4.202438.14664@ux1.cso.uiuc.edu> phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes: >I want to pass around integer numbers that I know will require more than >32 bits but not more than 63 bits. >I want to specify it sufficiently that a reasonable implementation on a 64 bit >machine will in fact use the 64 bit integer instructions. Whatever way it >is to be specified should work on all such 64 bit machines. The question is, should it also work on non-64 bit architectures? If not, just use "long". If so, you'll need some fairly obvious type definitions, macros, etc. To automatically configure your code to accommodate both types of architecture, you can make the definitions conditional on some arithmetic property in the preprocessor that will produce different results in the two environments; for example you could test for sign extension of the 32nd bit.