[comp.std.c] "Broken" compilers

scjones@sdrc.UUCP (Larry Jones) (05/02/90)

In article <1626@tkou02.enet.dec.com>, diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
> In article <1990Apr26.125851.20728@contact.uucp> ross@contact.UUCP (Ross Ridge) writes:
> >The macro a expands to 5 517 094 707 031 349 characters.
> 
> Yeah, I thought that was greater than 509.  I tried to run a program to check
> whether 5 517 094 707 031 349 was greater than 509, but got an error message.
> Actually the logical line is a bit longer than that, because there are a few
> more characters on the same source line outside of the macro invocation.
> 
> To repeat Peter Klausler's statement:
> <	 - does not exceed (or approach) any of the limits in 2.2.4.1
> 
> give or take a limit, eh?

If you check the phases of translation, however, logical lines
are a well-defined concept that occur BEFORE macro expansion.
Since the preprocessor grammar is token based, the result of
preprocessing is a stream of tokens, not logical lines, so the
size of the result is not subject to the logical line length
limit!
----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones@SDRC.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150-2789             AT&T: (513) 576-2070
"You know how Einstein got bad grades as a kid?  Well MINE are even WORSE!"
-Calvin

diamond@tkou02.enet.dec.com (diamond@tkovoa) (05/02/90)

In article <16582@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
 >In article <1626@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
 >>In article <1990Apr26.125851.20728@contact.uucp> ross@contact.UUCP (Ross Ridge) writes:
 >>>The macro a expands to 5 517 094 707 031 349 characters.
 >>
 >>Yeah, I thought that was greater than 509.
 >
 >The 509-character limit to which you seem to refer is for a "logical source
 >line", which is what you have after backslash-newline splicing but *before*
 >macro expansion.  Peter's example does not exceed this limit.

A logical source line means *both* before and after macro expansion.  The
limit applies until phase 7.  (I also have a letter from Tom Plum, though
not a formal ANSI ruling, that the limit applies after macro expansion.)

-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
This_blank_intentionally_left_underlined________________________________________

bph@buengc.BU.EDU (Blair P. Houghton) (05/03/90)

In article <1640@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
>In article <16582@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
> >The 509-character limit to which you seem to refer is for a "logical source
> >line", which is what you have after backslash-newline splicing but *before*
> >macro expansion.  Peter's example does not exceed this limit.
>
>A logical source line means *both* before and after macro expansion.  The
>limit applies until phase 7.  (I also have a letter from Tom Plum, though
>not a formal ANSI ruling, that the limit applies after macro expansion.)

Just thought I'd add that you'll never quite get a "formal
ANSI ruling" on it, as ANSI doesn't do interpretations,
according to the description on the copyright page (guess
whose copy just arrived, a mere 9 days after he mailed the
check -- would that the standard itself were put together
so promptly...).  They suggest writing to the Computer and
Business Equipment Manufacturers Association.

So, a letter from Tom Plum, Vice Chair of Technical
Committee X3J11, is about as formal as it gets.

(Interestingly enough, the clause where ANSI states they don't
give interpretations is mere words after the one that states
they don't develop standards...)

				--Blair
				  "Yup, it's ambiguous."

P.S.  Hey, Doug!  Where's the part where it says I can add &x to &y?
P.P.S.  *&:-)

gwyn@smoke.BRL.MIL (Doug Gwyn) (05/03/90)

In article <5776@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
>So, a letter from Tom Plum, Vice Chair of Technical
>Committee X3J11, is about as formal as it gets.

NO!!  Tom Plum is no more able to issue official X3J11 interpretations
of the ANSI Standard than I am.  I've described several times how to
go about getting an official interpretation ruling.