An excellent book on portability is "Portable C" by Henry Rabinowitz and Chaim Schaap. Prentice-Hall, 1990. It includes numerous examples and a really good index to help you find recommendations/pitfalls on particular areas. It covers both machine portability problems, compiler inconsistencies and general program style issues for easing portablility.