Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!eecae!tank!shamash!com50!jhereg!mark From: mark@jhereg.Jhereg.MN.ORG (Mark H. Colburn) Newsgroups: comp.lang.c Subject: Re: Max line length (was Re: programming challenge ...) Message-ID: <648@jhereg.Jhereg.MN.ORG> Date: 13 Mar 89 06:34:58 GMT References: <2102@jasper.UUCP> <207600017@s.cs.uiuc.edu> <9777@bloom-beacon.MIT.EDU> <11005@pasteur.Berkeley.EDU> Reply-To: mark@jhereg.MN.ORG (Mark H. Colburn) Organization: Minnetech Consulting, Inc., St. Paul, MN Lines: 22 In article <11005@pasteur.Berkeley.EDU> klatchko@cory.Berkeley.EDU.UUCP (ron klatchko) writes: +In article <9777@bloom-beacon.MIT.EDU> jfc@athena.mit.edu (John F Carr) writes: +>>Of course, you need to delete the newline after the first line. +> +>What is the longest line allowed in a C program? Does the standard say? +>Do present compilers care? + +That is implementation dependent. If your compiler attempts to read in +an entire line at a time and digest it, then you're compiler would have +some maximum length. If the compiler reads the the code in character by +character (lex does this), then there should be no maximum length. The proposed standard does say that all compilers must be able to support at least a 509 character logical source line. (ss 2.2.4.1 Environmental Considerations). Obviously, if your compiler supports more, that is fine, but as a programmer, you should not write code that would require lines longer than 509 characters after they have been combined. -- Mark H. Colburn "Look into a child's eye; Minnetech Consulting, Inc. there's no hate and there's no lie; mark@jhereg.mn.org there's no black and there's no white."