[Coco] "C" Compiler C_PREP19 errors or mine?
Stephen H. Fischer
SFischer1 at Mindspring.com
Sat May 21 14:54:53 EDT 2011
Hi,
So no decimal codes, that was what I got from web.
As C_PREP19 is a C_Prep for CoCo OS-9 "C" and that compiler allows decimal
codes then the suggestion to use C_PREP19 is perhaps not a good one.
Other versions may be better. I used cc2 in the past.
But as the MW CoCo OS-9 "C" Compiler is the compiler to be used and it does
NOT support what you provided and I can not find anything in the
ANSIFront.doc I still do not now what is going on with C_PREP19.
I checked and the MW CoCo OS-9 "C" Compiler did produce the correct codes so
the "Syntax error - Illegal escape sequence ***" messages are warnings only.
Still I wonder if a new version of the MW CoCo OS-9 "C" Compiler was
planned. I did find "Csources.zip" and it sure suggests that that an ANSI
Compiler was in the works.
SHF
"Michael Furman" <n6il-WxERUAI6ha4 at public.gmane.org> wrote in message
news:D1C470C4-BA96-4AC1-AA7F-4EF66A65CEC0 at ocs.net...
>I just cracked open my copy of "C: A Reference Manual, Fourth Edition; 1995
>to help answer your question. This has been the best C reference ever for
>me, it answers almost any question I have ever had.
>
> Section 2.7.5 explains escape characters. The bnf-style syntax is as
> follows. The book claims that this bnf describes ISO Standard C:
>
> escape-character:
> \ escape-code
>
> escape-code:
> character-escape-code
> octal-escape-code
> hex-escape-code
>
> character-escape-code: one of
> n t b r f
> v \ ' "
> a ?
>
> octal-escape-code:
> octal-digit
> octal-digit octal-digit
> octal-digit octal-digit octal-digit
>
> hex-escape-code:
> x hex-digit
> hex-escape-code hex-digit
>
> octal-digit: one of
> 0 1 2 3 4 5 6 7
>
> hex-digit: one of
> 0 1 2 3 4 5 6 7 8 9
> A B C D E F a b c d e f
>
> That's it. It goes on to explain:
>
> "If the character following the backslash is neither an octal digit, the
> letter x, nor one of the character escape codes listed above, the result
> is undefined (In traditional C, the backslash was ignored.) In ISO C, all
> lowercase letters following the backslash are reserved for future language
> extensions. Uppercase letters may be used for implementation specific
> extensions."
>
> According to this definition, there is no way to have decimal escape codes
> in C.
>
> Further I did the following experiment using bash shell. This follows
> everything stated above:
>
> $ printf "\x1BM\x1Bl\d010\x1BQ\d090" | hexdump -C
> 00000000 1b 4d 1b 6c 5c 64 30 31 30 1b 51 5c 64 30 39 30
> |.M.l\d010.Q\d090|
> 00000010
>
> I hope this answers your question.
>
More information about the Coco
mailing list