64 bit architectures and C/C++

Phil Howard KA9WGN phil at ux1.cso.uiuc.edu
Mon Apr 29 15:07:15 AEST 1991


shap at shasta.Stanford.EDU (shap) writes:

>2. If a trade-off has to be made between compliance and ease of
>porting, what's the better way to go?

User selectable.

>3. If conformance to the standard is important, then the obvious
>choices are

>	short	16 bits
>	int	32 bits
>	long	64 bits
>	void *	64 bits

That depends on the natural address size of the machine.  If the
machine uses 32 bit addresses, then (void *) should be 32 bits.
I would not want my address arrays taking up more memory than is
needed.

Is it really necessary that sizeof(void *) == sizeof(long)?

>How bad is it for sizeof(int) != sizeof(long). 

Would not bother me as long as sizeof(int) <= sizeof(long)

>4. Would it be better not to have a 32-bit data type and to make int
>be 64 bits?  If so, how would 32- and 64- bit programs interact?

Again it would depend on the machine.  If the machine has both 32 bit
and 64 bit operations, then do include them.  If a 32 bit operation
is unnatural to the machine, then don't.  If it has 16 bit operations
then that makes sense for short.
-- 
 /***************************************************************************\
/ Phil Howard -- KA9WGN -- phil at ux1.cso.uiuc.edu   |  Guns don't aim guns at  \
\ Lietuva laisva -- Brivu Latviju -- Eesti vabaks  |  people; CRIMINALS do!!  /
 \***************************************************************************/



More information about the Comp.lang.c mailing list