Max line length (was Re: programming challenge ...)

Mark H. Colburn mark at jhereg.Jhereg.MN.ORG
Mon Mar 13 16:34:58 AEST 1989


In article <11005 at pasteur.Berkeley.EDU> klatchko at cory.Berkeley.EDU.UUCP (ron klatchko) writes:
+In article <9777 at bloom-beacon.MIT.EDU> jfc at 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 at jhereg.mn.org                there's no black and there's no white."



More information about the Comp.lang.c mailing list