Article View: comp.std.c
Article #4168Re: Maximum length of line of C code
From: Paul Long
Date: Tue, 03 Oct 1995 23:07
Date: Tue, 03 Oct 1995 23:07
41 lines
2563 bytes
2563 bytes
berthold@ix.netcom.com (Richard Berthold) wrote:
>I have written a program which outputs C code and recently ran into a
>problem under OpenVMS related to the length of lines of code. It is not
>difficult to split the output into multiple lines with a \ at the end
>of the multiple lines but I have some questions about how sophisticated
>an algorithm must be used.
Geez, this sounds familiar. I wrote a paper about this that was published
in the June, 1991 issue of _The Journal of C Language Translation_. Contact
John Levine at jclt@iecc.com for information about back issues. Now that
I think about it, though, the previous owner, Rex Jeaschke, may own the
copyright. I may be able to find the code I wrote that'll do all the
splitting for you automatically between tokens.
>Any help with the following types of questions would be appreciated.
>
>Is there a limit to the number of characters in a physical line of C
>code which a "standard" compiler must be able to read (ie all lines
>must be less than 80 characters etc)?
There is the 509-character logical-source-line translation limit. Because
physical lines are spliced into logical lines, your physical lines cannot be
larger than that and still be strictly conforming.
>If there is no standard limit, does anyone know of any current
>compilers with small limits ie < 512 ?
No, but I haven't tried. :-)
>Must all compilers support \ as a line continuation character?
All conforming C compilers must, yes. Borland once acknowledged a bug
to me regarding line continuation. Don't know if they fixed it. (BTW,
I doubt whether there are _any_ conforming implementations. Seems like
everybody has some little wart that precludes it.)
--
Paul Long 45:29:14N 122:48:09W
plong@perf.com http://www.teleport.com/~pciwww/
"Where time or intelligence are lacking, a goto may do the job."
- M.E. Hopkins, "A Case for the GOTO," 1972.
Technical Details
Message-ID:
<44sfo3$mbe@news0.rain.rg.net>Path:
arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenetReferences:
<44qg8v$s1m@ixnews2.ix.netcom.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenet From: Paul Long <plong@perf.com> Newsgroups: comp.std.c Subject: Re: Maximum length of line of C code Date: 3 Oct 1995 23:07:47 GMT Organization: Performance Computing Incorporated Message-ID: <44sfo3$mbe@news0.rain.rg.net> References: <44qg8v$s1m@ixnews2.ix.netcom.com> NNTP-Posting-Host: yosemite.perf.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c) X-URL: news:44qg8v$s1m@ixnews2.ix.netcom.com