Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!ctnews!pyramid!batcomputer!itsgw!csmbox!rpics!guilford From: guilford@rpics.UUCP Newsgroups: comp.sys.amiga Subject: Re: Portable "C" Code Message-ID: <1102@rpics.RPI.EDU> Date: Fri, 10-Apr-87 13:32:15 EST Article-I.D.: rpics.1102 Posted: Fri Apr 10 13:32:15 1987 Date-Received: Fri, 17-Apr-87 00:37:21 EST References: <8704071939.AA09157@cory.Berkeley.EDU> Lines: 32 Summary: Why is C-code not portable? I've read several articles dealing with the incompatibilities between lattice and manx C-compilers. This may be a naive question, but why is there such an incompatibility? Isn't the purpose of a High-Level-Language to avoid such problems. I can understand that manx has a small memory model that passes small ints to subroutines. It seems to me that as long as the entire program was compiled by the same compiler, this should not matter unless one used one's own assembler code. (It could also be a problem if one used 'int' and assumed that it was long--but since C doesn't specify the size of int, one should have used long anyways.) The other source of problems would be in what subroutines are supplied and possibly different reactions from the same subroutines in different versions. The reason that I am asking this is that I am tired of fighting with this incompatibility. I hate it when someone writes some nifty program, posts it on the net (source only), and specifies that it should be compiled under manx. I, however (regardless of whether this is good or bad) only have lattice. I try to compile the silly thing there, and I get a couple of screen fulls of errors. Now I can either try to hack the code to work, or hope that the author is going to post the binary at some future time. This seems to me to be a silly way to work. What I am really wondering is if the sources of the incompatibilities are in the above, fairly unavoidable, places, or whether the programmers are writing in sleazy, non-portable ways that are geared to work with the quirks of their favorite compiler (or is there some other incompatibility that I haven't thought of?)? I would think that people writing in C, using the starndard RKM routines would produce portable code. Is it really that difficult? I'm rather new at usenet, so I hope I haven't offended anyone. --Jim Guilford (guilford@csv.rpi.edu)