Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > lcc-win32 conformance question

Reply
Thread Tools

lcc-win32 conformance question

 
 
teapot
Guest
Posts: n/a
 
      04-25-2008

If I compile this program

int main(void)
{
return 0; // foo bar baz
}

with

"lc -A -ansi89 foo.c"

(minus the quotes), no diagnostic is produced; but isn't this style of
comment illegal in C89 and thus this piece of code should be invalid?

How standards conformant is (unnamed compiler)?

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      04-25-2008
teapot wrote:
> If I compile this program
>
> int main(void)
> {
> return 0; // foo bar baz
> }
>
> with
>
> "lc -A -ansi89 foo.c"
>
> (minus the quotes), no diagnostic is produced; but isn't this style of
> comment illegal in C89 and thus this piece of code should be invalid?
>
> How standards conformant is (unnamed compiler)?
>

Why are you asking on a C++ group?

--
Ian Collins.
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      04-25-2008
Ian Collins wrote:
> teapot wrote:
>> If I compile this program
>>
>> int main(void)
>> {
>> return 0; // foo bar baz
>> }
>>
>> with
>>
>> "lc -A -ansi89 foo.c"
>>
>> (minus the quotes), no diagnostic is produced; but isn't this style of
>> comment illegal in C89 and thus this piece of code should be invalid?
>>
>> How standards conformant is (unnamed compiler)?
>>

> Why are you asking on a C++ group?
>

Oops, I buggered that up, wrong group open...

--
Ian Collins.
 
Reply With Quote
 
Bartc
Guest
Posts: n/a
 
      04-26-2008

"teapot" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> If I compile this program
>
> int main(void)
> {
> return 0; // foo bar baz
> }
>
> with
>
> "lc -A -ansi89 foo.c"
>
> (minus the quotes), no diagnostic is produced; but isn't this style of
> comment illegal in C89 and thus this piece of code should be invalid?
>
> How standards conformant is (unnamed compiler)?


You mean, the unnamed compiler called lcc-win32?

Well, I couldn't get an error message from it. Neither from using
DigitalMars DMC -A.

GCC of course complained, but then with it's 10000 options it would be odd
if it missed that one.

Sorry I didn't have any more command-line compilers to try..

I guess some are strictly conformant are some aren't. Perhaps there should
be a certificate issued to conformant ones to stop you absentmindedly
sneaking in a // comment or two!

--
bartc



 
Reply With Quote
 
Ben Bacarisse
Guest
Posts: n/a
 
      04-26-2008
teapot <(E-Mail Removed)> writes:

> If I compile this program
>
> int main(void)
> {
> return 0; // foo bar baz
> }
>
> with
>
> "lc -A -ansi89 foo.c"
>
> (minus the quotes), no diagnostic is produced; but isn't this style of
> comment illegal in C89 and thus this piece of code should be invalid?


If the compiler claims conformance to the obvious standard when passed
that flag then it is in error. Of course, just passing flag means
nothing. Does the documentation claim conformance to C90 (= ANSI C89)?

> How standards conformant is (unnamed compiler)?


Do you mean lcc-win32? If so, I have found problems with compound
literals, VLA parameters, complex numbers and designated initialisers
so some of the C99 parts are a bit rough round the edges. There have
been a few other reports of conformance issues, but they may well have
been fixed. For example, it used to consider long * and int * to be
compatible types.

It is probably fair to say the standards conformance is not a top
priority for that compiler.

--
Ben.
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      04-26-2008
Ian Collins wrote:
> teapot wrote:
>> If I compile this program
>>
>> int main(void)
>> {
>> return 0; // foo bar baz
>> }
>>
>> with
>>
>> "lc -A -ansi89 foo.c"
>>
>> (minus the quotes), no diagnostic is produced; but isn't this style of
>> comment illegal in C89 and thus this piece of code should be invalid?
>>
>> How standards conformant is (unnamed compiler)?
>>

> Why are you asking on a C++ group?
>


Because ****ing lcc-win is his favorite spot, like my cat
that ****es everywhere even in my computer!



--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      04-26-2008
jacob navia wrote:

> Ian Collins wrote:
>> teapot wrote:
>>> If I compile this program
>>>
>>> int main(void)
>>> {
>>> return 0; // foo bar baz
>>> }
>>>
>>> with
>>>
>>> "lc -A -ansi89 foo.c"
>>>
>>> (minus the quotes), no diagnostic is produced; but isn't this style
>>> of comment illegal in C89 and thus this piece of code should be
>>> invalid?
>>>
>>> How standards conformant is (unnamed compiler)?
>>>

>> Why are you asking on a C++ group?
>>

>
> Because ****ing lcc-win is his favorite spot, like my cat
> that ****es everywhere even in my computer!


In any case is what the OP claims true? Are there command-line switches
to get a diagnostic for C++ style comments when compiler in strict C90
mode?

PS. I think you should cool down a little and not give these anonymous
posters much weightage (except if they do uncover a real issue in
lcc-win). Even your prose has started suffering.

 
Reply With Quote
 
Serve Laurijssen
Guest
Posts: n/a
 
      04-26-2008

"teapot" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
>
> If I compile this program
>
> int main(void)
> {
> return 0; // foo bar baz
> }
>
> with
>
> "lc -A -ansi89 foo.c"
>
> (minus the quotes), no diagnostic is produced; but isn't this style of
> comment illegal in C89 and thus this piece of code should be invalid?
>
> How standards conformant is (unnamed compiler)?


oh no it accepts C++ style comments!!
really, who cares!!

>


 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      04-26-2008
Serve Laurijssen wrote:

>
> "teapot" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
>>
>> If I compile this program
>>
>> int main(void)
>> {
>> return 0; // foo bar baz
>> }
>>
>> with
>>
>> "lc -A -ansi89 foo.c"
>>
>> (minus the quotes), no diagnostic is produced; but isn't this style
>> of comment illegal in C89 and thus this piece of code should be
>> invalid?
>>
>> How standards conformant is (unnamed compiler)?

>
> oh no it accepts C++ style comments!!
> really, who cares!!


Anyone who wants to compile the same code under a strictly C90
conforming mode on another compiler which does reject C++ style
comments as syntax errors. All is well if that compiler happens to have
a switch to make it specifically accept this comment style while
retaining strict C90 conformance in all other respects, but most
compilers don't have such fine-grained control. You'll probably need to
compile the code under either C99 conformance (which in turn may not
even be available), or in some other "relaxed" mode which might accept
other non-C90 constructs that would otherwise have been diagnosed.

 
Reply With Quote
 
ymuntyan@gmail.com
Guest
Posts: n/a
 
      04-26-2008
On Apr 25, 7:17 pm, Ben Bacarisse <(E-Mail Removed)> wrote:
> teapot <(E-Mail Removed)> writes:
> > If I compile this program

>
> > int main(void)
> > {
> > return 0; // foo bar baz
> > }

>
> > with

>
> > "lc -A -ansi89 foo.c"

>
> > (minus the quotes), no diagnostic is produced; but isn't this style of
> > comment illegal in C89 and thus this piece of code should be invalid?

>
> If the compiler claims conformance to the obvious standard when passed
> that flag then it is in error.


Why is it an error? A C90 compiler can reject that program,
that's clear; but why does it have to?

Yevgen
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
W3C complience checker and conformance EN HTML 45 05-04-2006 11:40 PM
c library conformance testing cenan.ozen@gmail.com C Programming 0 12-01-2005 07:20 PM
Is there any new C++ compiler standard conformance test result? Tao Wang C++ 7 11-07-2005 02:24 PM
[Maybe OT] How to convince people about the importance of ANSI standards conformance ? Amarendra GODBOLE C Programming 25 01-21-2004 01:46 PM
Triple-A conformance? T.J. HTML 20 12-16-2003 08:37 AM



Advertisments