home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16659 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.1 KB  |  21 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!hp4at!gese!sca
  3. From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
  4. Subject: Re: Int,short int and portability of code
  5. Message-ID: <1992Nov17.100749@gese.ge14.mdadv.gv.at>
  6. Sender: usenet@hp4at.eunet.co.at (USENET - Admin account)
  7. Nntp-Posting-Host: gese.ge14.mdadv.gv.at
  8. Organization: MD-ADV, Vienna, Austria
  9. References:  <nyarko.721928336@ee.ualberta.ca>
  10. Date: Tue, 17 Nov 1992 09:07:49 GMT
  11. Lines: 8
  12.  
  13. My experiences in porting code (from VAX/VMS with 4-byte ints to MS/DOS/WOINDOWS with 2-byte ints) were that you can avoid most of the problems by explicitliy declaring your variables as "short" or "long".
  14. Well, most but not all problems: a whole bunch of library routines (i.e. printf, memcpy) take an int as parameter. And therefore int's have to be the size the library is expecting, right ?
  15. To be honest: with printf (and vprintf for variable arglists) my aproach was VERY empiric ...
  16.  
  17. regards, Petzi
  18. -- 
  19. Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
  20. MD-ADV, Municipality of the City of Vienna, Austria
  21.