[comp.lang.c] 509??

bph@buengc.BU.EDU (Blair P. Houghton) (03/14/89)

John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
accept at least 509 chars of logical line...

Huh???

Do X3J11 do their discussing ain between trips to the 7-11 to buy
lottery tickets or something?

Did they hit the trifecta at Rosemont betting 5-0-9? (probably required
themselves to box...:-)

				--Blair
				  "It is left as an exercise for
				   the compulsive-gambling reader
				   to figure out why the trifecta
				   will never hit."

gwyn@smoke.BRL.MIL (Doug Gwyn ) (03/14/89)

In article <2285@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
-John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
-accept at least 509 chars of logical line...
-Huh???
-Do X3J11 do their discussing ain between trips to the 7-11 to buy
-lottery tickets or something?
-Did they hit the trifecta at Rosemont betting 5-0-9? (probably required
-themselves to box...:-)

Please don't clutter the net with drivel.

Rest assured that there were good and sufficient reasons for that
particular number.  If you had asked politely I might even have
explained what they were.

vevea@paideia.uchicago.edu (Jack L. Vevea) (03/14/89)

In article <9847@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>
>Rest assured that there were good and sufficient reasons for that
>particular number.  If you had asked politely I might even have
>explained what they were.


Hmm.  Would it help if a third party asked politely?  I, and I'm sure
many others on the net, can't help but feel a little curiosity.










Saepe Fidelis.

bill@twwells.uucp (T. William Wells) (03/14/89)

In article <2285@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
: John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
: accept at least 509 chars of logical line...
:
: Huh???

I don't know the real reason. But here is a suggestion:

512 (a nice round number :-) - 1 CR - 1 LF - 1 NUL = 509.

In other words, the compiler might have a 512 character buffer and
reserve 3 bytes for the end of line stuff, leaving 509 characters for
the real text.

It's just a guess.

---
Bill
{ uunet | novavax } !twwells!bill
(BTW, I'm going to be looking for a new job sometime in the next
few months.  If you know of a good one, do send me e-mail.)

davidsen@steinmetz.ge.com (William E. Davidsen Jr) (03/15/89)

In article <2285@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:

| Do X3J11 do their discussing ain between trips to the 7-11 to buy
| lottery tickets or something?
| 
| Did they hit the trifecta at Rosemont betting 5-0-9? (probably required
| themselves to box...:-)

  Think about it... 512 is a power of two. If you want to keep the line
length in BCD you need three bytes for that. That leaves 509 for the
actual data. Identifiers are 31 characters to leave one byte for length,
flags, or whatever.

  Note that the standard does not require that the length be kept in
BCD, you could keep it in binary in two bytes and use a zero terminated
string. You could even keep the length in standard metric hexadecimal,
because it's implementation dependent.

  This answer is at least as serious as the question...
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

swilson@thetone.Sun.COM (Scott Wilson) (03/15/89)

In article <9847@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>Rest assured that there were good and sufficient reasons for that
>particular number.  If you had asked politely I might even have
>explained what they were.

Now go to bed without your supper.  Geez, the guy tries to inject a
little humor in this usually humorless place and he's treated like
a baby.  This kind of stuff reminds me of too many high school
teachers who were equally humorless.  Ok, Blair, you know what to
say: "forgive me Doug for I have sinned...."


--
Scott Wilson		arpa: swilson@sun.com
Sun Microsystems	uucp: ...!sun!swilson
Mt. View, CA

ftw@masscomp.UUCP (Farrell Woods) (03/15/89)

In article <9847@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <2285@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
>-John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
>-accept at least 509 chars of logical line...

>Rest assured that there were good and sufficient reasons for that
>particular number.  If you had asked politely I might even have
>explained what they were.

Allow me, then, to ask:  (without a whit of sarcasam) Why 509?


-- 
Farrell T. Woods				Voice:  (508) 392-2471
Concurrent Computer Corporation			Domain: ftw@masscomp.com
1 Technology Way				uucp:   {backbones}!masscomp!ftw
Westford, MA 01886				OS/2:   Half an operating system

prc@maxim.ERBE.SE (Robert Claeson) (03/16/89)

In article <2285@buengc.BU.EDU>, bph@buengc.BU.EDU (Blair P. Houghton) writes:
> John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
> accept at least 509 chars of logical line...
> 
> Huh???

On some weird os'es, the longest line that can be read from a text file
is that of a disk block minus one character. Then subtract two characters
for the line delimiter (CR-LF on most os'es). This will give you 509
characters.

-- 
Robert Claeson, ERBE DATA AB, P.O. Box 77, S-175 22 Jarfalla, Sweden
Tel: +46 (0)758-202 50  Fax: +46 (0)758-197 20
EUnet:   rclaeson@ERBE.SE               uucp:   {uunet,enea}!erbe.se!rclaeson
ARPAnet: rclaeson%ERBE.SE@uunet.UU.NET  BITNET: rclaeson@ERBE.SE

bph@buengc.BU.EDU (Blair P. Houghton) (03/17/89)

In article <9847@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <2285@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
>-John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
>-accept at least 509 chars of logical line...
>-Huh???
>-Do X3J11 do their discussing ain between trips to the 7-11 to buy
>-lottery tickets or something?
>-Did they hit the trifecta at Rosemont betting 5-0-9? (probably required
>-themselves to box...:-)
>
>Please don't clutter the net with drivel.
>
>Rest assured that there were good and sufficient reasons for that
>particular number.  If you had asked politely I might even have
>explained what they were.

Please don't clutter the net with arrogant pedantry.  You could have
whined by email.

The answers I've received so far indicate that:

5 responses:  There is a 512-byte maximum record length and the characters
'\r\n\0', in various order, are the three stripped off to make the maximum-
allowable-length logical line.

This does not explain the arbitrary(?) limit on record length.

1 response:  there is a 512-byte maximum record length, apparently
imposed because one manufacturer's machines were limited to 512-byte
maximum record length, and the three excised bytes were a '\0' and
two bytes to indicate the record length.

I've asked for more info on that last one.

				--Blair
				  "Nothing I hate worse than a
				   net-narc.  Putz.  :-|"

w-colinp@microsoft.UUCP (Colin Plumb) (03/17/89)

bph@buengc.bu.edu (Blair P. Houghton) wrote:
> John Carr and Doug Gwyn both quoted the pANS as requiring compilers to
> accept at least 509 chars of logical line...
> 
> Huh???

512 less a 3-byte EOL sequence.  Consider it to be 512 less CR/LF less
1 for good measure.
-- 
	-Colin (uunet!microsoft!w-colinp)

"Don't listen to me.  I never do." - The Doctor