Re: A C Adventure: your comments are welcome



On Aug 17, 4:24 pm, "bartc" <ba...@xxxxxxxxxx> wrote:
"Richard Heathfield" <r...@xxxxxxxxxxxxxxx> wrote in message

news:zf2dnUGbacq5bhXXnZ2dnUVZ8kBi4p2d@xxxxxxxxx





spinoza1111said:

On Aug 16, 9:06 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:

<snip>

The original text that you
posted contained a newline between the // and the 80, and that's a
syntax error even in C99. If lcc-win32 supports this (which I doubt
very much), it's broken.

Here, you're lying.

Would someone else please confirm that I'm telling the truth about a
newline in the OP's so-called "single-line comment"? Message ID is:
<597d9ef5-a9dd-4cf8-823c-028232bf8...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

<snip>

The comment wrapped. You're claiming that I would try to compile
"80" as a C statement, and this is absurd.

No, I'm claiming that you posted 80 as a C statement. In other words,
it appeared in code for which you invited comments.

This happens all the time with C code posted here. Usually the snippets are
small, and the obvious compilation errors it causes can be fixed without
even thinking about it.

(I think it can happen with *any* language that has comments that finish at
end-of-line, where code is posted to usenet (and some line-oriented
languages would have the problem even without comments). For example, Ada,
Basic, Python, Fortran you may possibly have heard of.)

It's really, really not a big deal. That fact that you have a jobsworth of a
compiler that refuses to recognise such a widely used comment style and
possibly doesn't have a simple option to enable them, is your problem.

--
Bartc- Hide quoted text -

- Show quoted text -

The real problem is that no straight answer is available to the
question as to whether C, as human praxis and not some dead-on-arrival
standard, allows // style comments, and to many, many other questions
about C.
.



Relevant Pages

  • Re: A C Adventure: your comments are welcome
    ... syntax error even in C99. ... If lcc-win32 supports this (which I doubt ... and the obvious compilation errors it causes can be fixed without even thinking about it. ... (I think it can happen with *any* language that has comments that finish at end-of-line, where code is posted to usenet (and some line-oriented languages would have the problem even without comments). ...
    (comp.lang.c)
  • Re: a perl script crashed my mac!
    ... I have never seen an OS X computer crash until ... >> kernel panic because it doesn't compile, let alone execute. ... syntax error at frog line 12, ... Execution of frog aborted due to compilation errors. ...
    (comp.lang.perl.misc)
  • Re: Function to compares two arrays and returns indices where they are equivalent
    ... Running the code is like compiling the ... But if you have syntax error, ... in any language, even Fortran. ... language, if all things being equal, but they are not, for me. ...
    (comp.lang.fortran)
  • Re: Renaissance of Forth
    ... desire to treat C as a portable assembly language. ... Nobody needs to have an actual interpreter or compiler for this ... a special type for strings, or add an extension to C's grammar. ... But that's a syntax error to C. So maybe we ugly it up a bit: ...
    (comp.lang.forth)
  • Re: need help..
    ... >>> It should be a syntax error. ... an assignment is an expression ... in the context of a new language. ... CLC FAQ ...
    (comp.lang.c)