home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16599 < prev    next >
Encoding:
Text File  |  1992-11-16  |  1016 b   |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!van-bc!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!ee.ualberta.ca!nyarko
  3. From: nyarko@ee.ualberta.ca (David Nyarko)
  4. Subject: Int,short int and portability of code
  5. Message-ID: <nyarko.721928336@ee.ualberta.ca>
  6. Lines: 20
  7. Sender: news@kakwa.ucs.ualberta.ca
  8. Nntp-Posting-Host: bode.ee.ualberta.ca
  9. Organization: University Of Alberta, Edmonton Canada
  10. Date: Mon, 16 Nov 1992 15:38:56 GMT
  11.  
  12. Hi,
  13. If I have a program compiled by a compiler (eg TurboC) which
  14. regards integers and short integers as 2 bytes size
  15. and want the same program to be run on another machine (eg 
  16. whose 'c' compiler (gcc or cc on sparcs) regards ints as 4 bytes
  17. and short ints as 2 bytes, is there a way of overriding
  18. the compiler defaults for these sizes in say the
  19. Makefile instead of having to have these definitions
  20. in all the individual 'c' files.
  21. ie
  22. if sparc
  23.     int = 2 bytes
  24.     short int = 2 byte
  25. endif
  26.  
  27. In order not to take much bandwidth, you can
  28. email responses to
  29.     nyarko@bode.ee.ualberta.ca
  30.  
  31.             David
  32.