Integer size with different compile


 
Thread Tools Search this Thread
Top Forums Programming Integer size with different compile
# 1  
Old 07-24-2017
Integer size with different compile

Hi All,

I am having two executable one is a 32 bit compiled version and other is 64 bit compiled version. I was in assumption the size of integer for 32 bit will be 2 ^32 and size of 64 bit compiled version will be 2 ^ 64. But in my case both are showing 2 ^32 I mean I am not able to go over size of 2 ^32. Any clarification will be helpful

Thanks
Arun
# 2  
Old 07-24-2017
cd to /usr/include

Two header files - limits.h and stdint.h have everything the compiler can know about integer sizes in bits, usually WORD_BITS and CHAR_BITS are used to define the rest of the macros.

You may have some compiler options to control long int size, I do not know.

Start with that. BTW you should have tried to read these and some other header files just to get an idea about what settings your compiler can and does employ.

There should be/is a man page for each of the important header files like math.h
# 3  
Old 07-24-2017
Quote:
Originally Posted by arunkumar_mca
I was in assumption the size of integer for 32 bit will be 2 ^32 and size of 64 bit compiled version will be 2 ^ 64.
You assumption was wrong.

Most 64 bit platforms (Windows, Linux, Solaris, AIX, HP-UX, MacOS, BSD, ...) have selected the LP64 data model, meaning an integer (i.e. an int in C) is still 32 bit while only long and pointers are 64 bits. This page explain why this was preferred against the various possible alternatives.
This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies

2. Solaris

/tmp size is less whereas size allocated to swap is more

Hi, the /tmp size is less whereas the size allocated to swap is quite big. how to increase the size of /tmp - #: swap -l swapfile dev swaplo blocks free /dev/md/dsk/d20 85,20 8 273096 273096 #: swap -s total: 46875128k bytes allocated + 2347188k reserved =... (2 Replies)
Discussion started by: psb74
2 Replies

3. Shell Programming and Scripting

Moving files based on size (string to integer)

I have a log file that I want to archive out as it reaches 100MB. I am using the following to get the file size into a variable but get the error "line 5: filesize=$(wc -c < logfile.log) if then echo "is greater than 100M" else echo "is less than 100M" fi I'm sure there's something... (2 Replies)
Discussion started by: Flakman
2 Replies

4. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

5. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

6. Shell Programming and Scripting

Script to read file size and send email only if size > 0.

Hi Experts, I have a script like $ORACLE_HOME/bin/sqlplus username/password # << ENDSQL set pagesize 0 trim on feedback off verify off echo off newp none timing off set serveroutput on set heading off spool Schemaerrtmp.txt select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies

7. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

8. Shell Programming and Scripting

The scripts not able to make the file to size 0, every times it go back to its original size

#!/bin/sh ########################################################################################################## #This script is being used for AOK application for cleaning up the .out files and zip it under logs directory. # IBM # Created #For pdocap201/pdoca202 .out files for AOK #1.... (0 Replies)
Discussion started by: mridul10_crj
0 Replies

9. Solaris

Directory size larger than file system size?

Hi, We currently have an Oracle database running and it is creating lots of processes in the /proc directory that are 1000M in size. The size of the /proc directory is now reading 26T. How can this be if the root file system is only 13GB? I have seen this before we an Oracle temp file... (6 Replies)
Discussion started by: sparcman
6 Replies

10. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies
Login or Register to Ask a Question