Harald van D©¦k <tr*****@gmail.comwrites:
On Thu, 04 Oct 2007 14:13:14 -0400, Kenneth Brody wrote:
>Spammer wrote:
>>It supports standard C/C++.
The standard says that "C/C++" is undefined.
If you include the quotation marks, it's just fine as a string literal.
Yup.
If you exclude the quotation marks, given that no definition or
declaration of C is present at the moment, it's a syntax error.
I briefly considered quibbling over the term "syntax error", but
then I remembered C99 6.5.1p2:
An identifier is a primary expression, provided it has been
declared as designating an object (in which case it is an lvalue)
or a function (in which case it is a function designator).
with a footnote:
Thus, an undeclared identifier is a violation of the syntax.
If you
want to add a declaration or definition of C, it can be done in ways that
lead to well-defined behaviour.
I'd be interested in seeing an example of that, preferably without the
use of macros. I'm skeptical that it's possible. C99 6.5p2:
Between the previous and next sequence point an object shall have
its stored value modified at most once by the evaluation of an
expression. Furthermore, the prior value shall be read only to
determine the value to be stored.
Of course, this is all a joke, and one that the OP is likely not to
get, so I'll explain it. We're pretending that ``C/C++'' is an
expression, with the "/" being a division operator. The OP uses the
term to refer to some mythical language that's a combination of C and
C++, which are two distinct but related languages. It's unfortunately
a very common term; the phrase "C or C++", or perhaps "C and C++",
would be more accurate. In any case, advertisements are generally not
welcome here.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"