Problems with GCC and/or VAX LINK

Arndt Jonasson arndt at ZYX.SE
Mon Mar 13 20:17:28 AEST 1989


In article <9776 at bloom-beacon.MIT.EDU> jfc at athena.mit.edu (John F Carr) writes:
>>	3.1.9 Comments
>>	  ... The contents of a comment are examined only to identify
>>	multibyte characters ...                          ^^^^^^^^^^^
>        ^^^^^^^^^^^^^^^^^^^
>
>Why?

So that the sequence '/' '*' isn't mistaken for the end of the comment
if it should occur "out of phase", so to speak. If there are multibyte
characters in the comment (the usual scheme I am aware of is to let
the first byte of a multi-byte character have its high bit set), the
character '/' might occur as the second component of such a character.
Then, if the next character happens to be an ordinary one-byte '*',
you will appear to have reached an end-of-comment, unless you keep
track of multi-byte characters.

All this amounts to in practice (at least for the purpose of parsing
comments) is to use a slightly more sophisticated character reader,
which always returns a multi-byte character, with the usual mono-byte
characters as a special case.
-- 
Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden
email address:   arndt at zyx.SE   or      <backbone>!mcvax!enea!zyx!arndt



More information about the Comp.lang.c mailing list