Path: utzoo!utgpu!radio!brian From: brian@radio.toronto.edu (Brian Glendenning) Newsgroups: comp.lang.c Subject: Portable Code Message-ID: <1157@radio.toronto.edu> Date: 21 Jul 88 18:23:25 GMT Reply-To: brian@radio.astro.toronto.edu (Brian Glendenning) Organization: Radio Astronomy, Dept. of Astronomy, U. of Toronto, Canada. Lines: 32 I am currently involved with porting/extending a networked graphics server I wrote for Sun 3 machines to Iris workstations, and it will likely be ported to new machines in the future. So I thought I'd ask the net for advice about how to write portable code. I know the topic is incredibly broad, but I expect I'm not the only person on the net who could benefit from some advice (e.g., people like myself who aren't primarily programmers and don't know the lore and wisdom of professionals). Some issues that could be addressed: 1) Byte order and type size differences. What is the best way for dealing with these? What are the "gotcha"'s? 2) BSD/SysV/whatever differences. What assumptions are likely to lead me into trouble? 3) Source code management: what's the best way to maintain codes that run on a variety of machines. #ifdef MACHINE_TYPE? Never or rarely use #ifdef, edit makefiles? ??? 4) Everything I've forgotten :-) Replies containing simple do's and dont's should be mailed to me and I will summarize to the net. Controversial or complex ideas should be posted to the net for discussion. Thanks in advance. -- Brian Glendenning INTERNET - brian@radio.astro.toronto.edu Radio Astronomy, U. Toronto UUCP - {uunet,pyramid}!utai!radio!brian +1 (416) 978-5558 BITNET - glendenn@utorphys.bitnet