Velocity Reviews - Computer Hardware Reviews

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

Thread Tools

lcc-win32 conformance question

Keith Thompson
Posts: n/a
      04-27-2008 Removed) writes:
> On Apr 27, 5:20 am, Keith Thompson <(E-Mail Removed)> wrote:

>> For example, since the identifier __attribute__ is reserved to the
>> implementation, no strictly conforming program may use it; therefore,
>> a conforming implementation may provide an extension that affects only
>> programs that use the identifier __attribute__.

> A program which uses // comments isn't strictly conforming
> either, so a conforming implementation may provide an extension...

Exactly. *But* that doesn't relieve the implementation of its
obligation to diagnose syntax errors.

>> But must the implementation still issue a diagnostic if the use of an
>> extension violates a constraint or syntax rule? In my opinion, the
>> answer is yes; the standard permits extensions, but that doesn't
>> override the requirement to issue a diagnostic. Doug Gwyn, a member
>> of the C standard committee, has expressed the same opinion over on
>> comp.std.c.

> Sounds right, and it doesn't explain why __attribute__ may get
> away without a warning

The C standard conformance police haven't caught up with them yet,
probably because they don't exist.

Keith Thompson (The_Other_Keith) <(E-Mail Removed)>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Reply With Quote
Hans Schneider
Posts: n/a
teapot schrieb:

> If I compile this program
> int main(void)
> {
> return 0; // foo bar baz
> }

That is no useful comment.

According to article <dsdahk$sq9$(E-Mail Removed)>,
"foo" and "bar" are not standardisiert.

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

Where is -ansi89 described?

I have lcc-win32 version 3.8 and it says only what -ansic is
but not -ansi89.

Why can you know it exists?

I think -ansi89 is not official.

> (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
Peter Nilsson
Posts: n/a
Richard Heathfield wrote:
> ... the appearance of a // in a C90 program is either:
> (a) part of a string literal " like // this "; or

(aa) character constant like '//'; or
(ab) token sequence to be stringised, like...

#define STR(x) #x

; or

> (b) part of a comment /* like // this */; or
> (c) a division followed immediately by a comment like//*this*/that; or

(e) ignored conditional block like...

#if 0
What do you mean // is not valid?

; or

> (d) a syntax error.
> I think that covers all the possibilities.

It can appear in a #include directive...

#include <//samba/usr/include/header.h>

.... though that probably excludes it from being a 'C90' program.
What's your view on it appearing in a #error directive?

Reply With Quote
Peter Nilsson
Posts: n/a
Oops, I didn't mean to send previous reply after reading Keith's.

Peter Nilsson wrote:
> Richard Heathfield wrote:
> > ... the appearance of a // in a C90 program is either:
> >
> > (a) part of a string literal " like // this "; or

> (aa) character constant like '//'; or


Reply With Quote

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 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