Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mtune!codas!usfvax2!chips From: chips@usfvax2.UUCP (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <821@usfvax2.UUCP> Date: Thu, 20-Aug-87 14:36:12 EDT Article-I.D.: usfvax2.821 Posted: Thu Aug 20 14:36:12 1987 Date-Received: Sat, 22-Aug-87 11:37:42 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <503@sugar.UUCP> Organization: AT Engineering, Tampa, FL Lines: 29 Summary: CR vs LF In article <503@sugar.UUCP>, peter@sugar.UUCP (Peter da Silva) writes: >> What is an implementation of C supposed to do on an OS/machine/character-code >> combination that doesn't have the foggiest that there is such a thing >> as distinct "new line" and "carriage return" characters? From the looks of >> the discussion here, I'd gather that OS9 is just such a beast and its C >> compiler is making the best of this brain damaged situation that it can. This compiler botched the job. > There is no "new line" character in ASCII. UNIX uses "line feed" as the new > line character. OS/9 uses "carriage return". I'd say the 'C' language itself > is suffering from parochialism here. Not quite; no useful language can pander to every (hostile? :-]) environment. > I would say that > since OS/9 is a UNIX lookalike, using CR for NL instead of LF was probably > not the best choice... but at least it's better than using both of them. I once re-targeted a UNIX C compiler from the Z-80 to the 6809, so as to compile OS-9 programs. My solution to the above-mentioned problem was to define '\n' as 0x0D and '\r' as 0x0A. This did not produce the correct behavior for '\r', but it did prevent the ('\r' == '\n') problem; and since the OS-9 I/O services consider 0x0D as `newline' (CR-LF), it would have been _very_ difficult to make '\r' behave correctly anyway. -- Chip Salzenberg UUCP: "uunet!ateng!chip" or "chips@usfvax2.UUCP" A.T. Engineering, Tampa Fidonet: 137/42 CIS: 73717,366 "Use the Source, Luke!" My opinions do not necessarily agree with anything.