Portable Code

Brian Glendenning brian at radio.toronto.edu
Fri Jul 22 04:23:25 AEST 1988


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 at radio.astro.toronto.edu
Radio Astronomy, U. Toronto          UUCP - {uunet,pyramid}!utai!radio!brian
+1 (416) 978-5558                  BITNET - glendenn at utorphys.bitnet



More information about the Comp.lang.c mailing list