home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!van-bc!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!ee.ualberta.ca!nyarko
- From: nyarko@ee.ualberta.ca (David Nyarko)
- Subject: Int,short int and portability of code
- Message-ID: <nyarko.721928336@ee.ualberta.ca>
- Lines: 20
- Sender: news@kakwa.ucs.ualberta.ca
- Nntp-Posting-Host: bode.ee.ualberta.ca
- Organization: University Of Alberta, Edmonton Canada
- Date: Mon, 16 Nov 1992 15:38:56 GMT
-
- Hi,
- If I have a program compiled by a compiler (eg TurboC) which
- regards integers and short integers as 2 bytes size
- and want the same program to be run on another machine (eg
- whose 'c' compiler (gcc or cc on sparcs) regards ints as 4 bytes
- and short ints as 2 bytes, is there a way of overriding
- the compiler defaults for these sizes in say the
- Makefile instead of having to have these definitions
- in all the individual 'c' files.
- ie
- if sparc
- int = 2 bytes
- short int = 2 byte
- endif
-
- In order not to take much bandwidth, you can
- email responses to
- nyarko@bode.ee.ualberta.ca
-
- David
-