We will call a program portable if adapting it to a new environment is easier than rewriting it for that environment. This document is mainly for those who have never ported a program to another platform -- a specific hardware and software environment -- and, evidently, for those who plan to write large systems which must be used across different vendor machines. If you have already done some porting, you may not find the information herein very useful.
We suggest that Recommended C Style and Coding Standards [1] be read in conjunction with this document. (1) Posters to the newsgroup comp.lang.c have repeatedly recommended Portable C Software [4] and C Traps and Pitfalls [8] (none of the information herein has been taken from those two references).
Disclaimer: We will attempt to keep the information herein updated, but it can happen that some of it may be incorrect at the time of reading. The code fragments presented are intended to make applications "more" portable, meaning that they may fail with some compilers and/or environments.
This document can be obtained via anonymous FTP from sauna.hut.fi [130.233.251.253] in ~ftp/pub/CompSciLab/doc. The files portableC.tex, portableC.sty, portableC.bib, and portableC.ps.Z are the LaTex source and style files, BibTeX and the compressed PostScript, respectively. Alternatively, there is a site in the US from which one can obtain all four files, cs.washington.edu [128.95.1.4] in ~ftp/pub/cport.tar.Z. All files are in the public domain. Comments, suggestions, flames, eggs, and requests for copies via e-mail should be directed to ado@sauna.hut.fi.
contents
Abstract
Introduction