1) Where is the charter for this group (if there is one)?
2) Where is the FAQ for this group (if there is one)?
Responses by E-mail are appreciated.
Also, please understand in advance that letters in which the author
"explains the purpose of the newsgroup" are okay, but necessarily
don't carry the same weight as either of the two documents mentioned.
(Just trying to get to the heart of it.)
Thank you.
Tom Baker
C/C++/Unix
Time for a reminder. comp.std.c as such has no FAQ list.
The FAQ list on comp.lang.c is very, very good, however. Since it's
about the C language, ANSI standards issues are very well covered there,
along with pre-ANSI idioms.
--
Stan Brown, Oak Road Systems br...@Ncoast.ORG
Can't find FAQ lists? ftp to 'rtfm.mit.edu' and look in /pub/usenet
(or email me >>> with valid reply-to address <<< for instructions).
Thanks,
JFK
p00...@psilink.com
It's OK for a compiler to accept control characters in string
constants, but the your code isn't strictly-conforming. The reason
control codes are excluded is that they cannot be represented on all
machines. Not all machines *have* control-A.
--
#include <standard.disclaimer>
_
Kevin D Quitt 96.37% of all statistics are made up
Thanks,
John
p00...@psilink.com
ANSI Classic section 2.2.1, page 11 lines 25 to 26, says yes: "In both
the source and execution basic character sets, the value of each character
after 0 in the above list of decimal digits shall be one greater than the
value of the previous."
--
<< If this were the company's opinion, I would not be allowed to post it. >>
A program in conformance will not tend to stay in conformance, because even if
it doesn't change, the standard will. Force = program size * destruction.
Every technical corrigendum is met by an equally troublesome new defect report.
As another respondent pointed out, this would render your program not
strictly conforming. However, this is already a fuzzy area in the standard.
The conversion from physical source file characters to the source character
set occurs in phase 1 but is not standardized and is not required to be
implementation-defined (ANSI classic section 2.1.1.2, page 6 lines 25 to 26).
A byte with numeric value 1 probably exists in the physical character set
and probably doesn't have a graphic associated with it, though it might not
be a control-A. An implementation is free to map it to a C character (such
as the letter A) but that would be rather rude. An implementation is also
free to map it to some other member of the basic source character set which
doesn't have to be defined. Your implementation did this.
If such a character occurs outside of a character constant, string literal,
comment, or preprocessing token that is never converted to a token, then
behavior is undefined (ANSI Classic section 2.2.1, page 11 lines 29 to 31).
But if such a character occurs inside one of those, such as your control-A
inside a string literal, then it seems that the behavior is not undefined.
The implementation must accept, but doesn't have to say what it did with it.
If you include a tab in a string literal then it works, but if you try to
include a newline in a string literal then it's a syntax error (ANSI Classic
section 3.1.4, page 31 lines 29 to 30).
Yes. ANSI Classic 2.2.1 states:
In both the source and execution character sets, the value of
each character above 0 in the above list of decimal digits shall be
one greater than the value of the previous.
|> Thanks,
|> John
|> p00...@psilink.com
|>
--
Chris Volpe
G.E. Corporate R&D
vol...@crd.ge.com
>In article <295763051...@psilink.com> "John R Kennedy" <p00...@psilink.com> writes:
>>control codes directly? I realize that inserting newlines or tabs directly
>>won't produce the desired result [...]
>If you include a tab in a string literal then it works, but if you try to
>include a newline in a string literal then it's a syntax error (ANSI Classic
>section 3.1.4, page 31 lines 29 to 30).
Seems you two don't agree whether a tab works (whatever that means) or
not. The problem John had was probably (guessing from my own experience
from using various editors) that Borland's editor (not compiler)
decided that John really didn't want a tab in there and silently
replaced it by an appropriate number of spaces.
ObStandardRelatedQuestion: Is the editor part of the C Implementation?
:-)
hp
--
_ | h...@vmars.tuwien.ac.at | Peter Holzer | TU Vienna | CS/Real-Time Systems
|_|_) |------------------------------------------------------------------------
| | | ...and it's finished! It only has to be written.
__/ | -- Karl Lehenbauer
For people interested in the latest standard, ISO/IEC 9899 section 5.2.1
contains exactly the same wording (and presumably exactly the same list
of decimal digits :-)
Lezz "not a language lawyer but training to be one" Giles