Does your C compiler support "//"? (was Re: using structures)

C

Chris Hills

Jack Klein said:
Visual C++ and any other compiler that supports that one is just plain
flat out wrong.

You know this, I know this but the person concerned when I told them
that the ISO standard did not do it the same way as VS told me that "you
would have thought the ISO C people would have got it right! They are
obviously out of touch!"

Apparently according to the "engineer" if MS do it that way then
Borland, Metrowerks, Keil, IAR and the ISO C people are wrong.... :)
I remember a very well known compiler for the 8051 where this would
work:
#define SOME_MACRO some_value /* some comment */
...but this would not:
#define SOME_MACRO some_value // some comment
...when the macro was used like this:
int x = SOME_MACRO;
When the // version was used, the compiler would complain about a
missing semicolon when it started parsing the following statement.

Apparently they were not replacing comments with a single space
character (phase 3) until after expanding macros (phase 4) so they
expanded the assignment statement to:

int x = some_value // some comment ;

...then processed the comment which removed the semicolon.

That sounds reasonable.

// are dangerous as are many parts of C.





/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
A

Al Grant

Chris Hills said:
You know this, I know this but the person concerned when I told them
that the ISO standard did not do it the same way as VS told me that "you
would have thought the ISO C people would have got it right! They are
obviously out of touch!"

Apparently according to the "engineer" if MS do it that way then
Borland, Metrowerks, Keil, IAR and the ISO C people are wrong.... :)

But MS don't do it that way, they do it the standard way.
I have tried VC++ 6.0 and 7.1 in standard and extended modes and
cannot replicate your claim; they do not ignore trailing spaces,
let alone trailing // comments.

This sort of unsubstantiated mud-slinging may be good enough for
comp.lang.c, but if you're going to accuse a leading implementor of
wilful non-conformance on comp.std.c, please produce some evidence,
or stop cross-posting.
 
C

Chris Hills

Al Grant said:
But MS don't do it that way, they do it the standard way.
I have tried VC++ 6.0 and 7.1 in standard and extended modes and
cannot replicate your claim; they do not ignore trailing spaces,
let alone trailing // comments.

This sort of unsubstantiated mud-slinging may be good enough for
comp.lang.c, but if you're going to accuse a leading implementor of
wilful non-conformance on comp.std.c, please produce some evidence,
or stop cross-posting.

I do not have direct access to an MS VC++ compiler. The two other people
concerned who were complaining to me about it had the MS compilers.
These were at two different companies. I will find out exactly which
versions of the MS compiler they had. Both (independently) were adamant
that the MS compiler was doing it differently to the rest. They were
convinced that the MS compiler was correct and the other one they had
was wrong.

BTW as for "wilful non conformance" AFAIK none of the compilers
mentioned, including the MS ones, are C99 compliant anyway.


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
J

James Kuyper

:
....
dv> I don't understand. The default mode of operation for my compiler
dv> of choice is strict ANSI,

It's not the "default mode of operation" if you have to add special
flags to make it operate that way. It may be the "default way you
invoke it", but that's not the same thing.

I believe he's claiming that he does NOT need to add special flags to
make it a conforming implementation of (some version of) the C standard.
There was a debate about that issue in the last year or so; we managed
to come up with several different compilers for which it was claimed
that their default mode conformed to the standard. All of them were
obscure. I strongly suspect that those claims went unchallenged, not
because they actually conformed, but simply because so few people used
those particular compilers that nobody on this newsgroup was aware of
the ways in which they failed to conform. Still, those claims were made,
and not challenged.
 
M

Martin Dickopp

Paul D. Smith said:
md> My point was that gcc, if invoked without any flags, does not even
md> claim to implement C as defined by any ISO standard or pre-C89 de
md> facto standard (K&R).

Well, I'm pretty sure that it implements a superset of C. That is, if
you have a conforming C program, GCC will properly compile it.

A conforming implementation must accept any /strictly/ conforming program.
Whether or not it accepts a conforming program is meaningless. In fact, a
conforming program is defined as a program that is acceptable to a
conforming implementation, so conformance of programs cannot possibly be
used to define conformance of implementations, or you would have a circular
definition. :)

Here is a strictly conforming program:

int main (void)
{
int typeof;
return 0;
}

gcc invoked without any flags doesn't compile it, therefore gcc is not a
conforming implementation of C in this mode.

Martin
 
R

Randy Howard

This sort of unsubstantiated mud-slinging may be good enough for
comp.lang.c, but if you're going to accuse a leading implementor of
wilful non-conformance on comp.std.c, please produce some evidence,
or stop cross-posting.

So, how are those MS stock options looking these days?

What sort of willful non-conformance would not supporting C99 a full
4 years after publication fall under btw? I can understand a lowly
open source package such as gcc (feel free to insert any of the other
FUD terms invented by Microsoft marketing to describe OSD here as
well) not supporting it by now, although they have made far, far more
progress than MS. Now, if Microsoft is really the reference standard
for professional software, how long should it take? Could it be
that they actually don't care at all about industry standards and in
fact eschew them at every opportunity?
 
S

Samuel Barber

Randy Howard said:
What sort of willful non-conformance would not supporting C99 a full
4 years after publication fall under btw?

Why should Microsoft support C99? They already implement an enhanced
version of C, by the name of C++. It's far more popular than C99.
(Microsoft has generally lagged in their C++ standard compliance,
incidentally, but this has improved lately).

Sam
 
S

Sven Semmler

Samuel said:
Why should Microsoft support C99? They already implement an enhanced
version of C, by the name of C++. It's far more popular than C99.

Because C and C++ are two different languages with two different
standards? Trolling?

/Sven
 
D

Dave Vandervies

:
...

I believe he's claiming that he does NOT need to add special flags to
make it a conforming implementation of (some version of) the C standard.

No, the compiler of choice to which I referred is gcc -W -Wall -ansi
-pedantic -O. This is a different compiler than, say, gcc -traditional
or unadorned gcc (or even gcc -W -Wall -ansi -pedantic -O2, if you're
going to be nitpicky enough).


dave

--
Dave Vandervies (e-mail address removed)
The minimum charge is 1 day, at $1000 per day (US), payable in advance.
Don't listen to Chuck, he's just trying to rip you off.
I'll do it for only $999. --CBFalconer and Ben Pfaff in comp.lang.c
 
R

Ross Ridge

Randy Howard said:
What sort of willful non-conformance would not supporting C99 a full
4 years after publication fall under btw? I can understand a lowly
open source package such as gcc (feel free to insert any of the other
FUD terms invented by Microsoft marketing to describe OSD here as
well) not supporting it by now, although they have made far, far more
progress than MS. Now, if Microsoft is really the reference standard
for professional software, how long should it take? Could it be
that they actually don't care at all about industry standards and in
fact eschew them at every opportunity?

Call it what you want, willful non-conformance or not, but no vendor
has released a complete implementation that claims C99 conformance.
Microsoft hasn't released a C99 conforming compiler because their
customers aren't asking for it. The same is true of other vendors.

The problem isn't with Microsoft or any other vendor. The problem is
with C99, it's a failed standard.

Ross Ridge
 
C

Chris Hills

Samuel said:
Why should Microsoft support C99? They already implement an enhanced
version of C, by the name of C++.

1 C++ is not an enhanced version of C

2 As you suggest MS does not support standard C
It's far more popular than C99.
(Microsoft has generally lagged in their C++ standard compliance,
incidentally, but this has improved lately).
Sam

3 you say MS do not support the current C++ standard.

So according to you MS support neither C or C++ but do their own thing.

I think that's where we came in.



/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
C

Chris Hills

Ross Ridge said:
Call it what you want, willful non-conformance or not, but no vendor
has released a complete implementation that claims C99 conformance.
Microsoft hasn't released a C99 conforming compiler because their
customers aren't asking for it. The same is true of other vendors.

AFAIK There are at least 2 compilers and 3rd party library that claim
C99 compliance. Yes customers are asking for C99
The problem isn't with Microsoft or any other vendor. The problem is
with C99, it's a failed standard.

That's true

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
F

Francis Glassborow

Chris Hills said:
That's true

Does your employer agree with that statement. If so why does he allow
you time off to attend C Standards meetings? If not, have you explained
to him how the C99 standard has failed and what actions you propose
should be taken?
 
D

Douglas A. Gwyn

Ross said:
Call it what you want, willful non-conformance or not, but no vendor
has released a complete implementation that claims C99 conformance.

That's not true. SGI has a compiler they advertise as conforming
to the 1999 C standard. There may be others.
 
C

Chris Hills

Francis Glassborow said:
Then you either misheard, or they misspoke or you are taking it out of
context.

Not at all. They were VERY clear and explicit about it. This has been
amplified by some of the more experienced members at other meetings
where you were not present. They were not IST/5/-14 meetings.

Perhaps it is you that does not understand which is why you voted the
opposite way to every one else on the last vote?

That is the end of this conversation.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
L

Larry__Weiss

Al said:
This sort of unsubstantiated mud-slinging may be good enough for
comp.lang.c, ...

Say what? My meta-mud-slinging detector started beeping and woke me up!
 
F

Francis Glassborow

Chris Hills said:
Not at all. They were VERY clear and explicit about it. This has been
amplified by some of the more experienced members at other meetings
where you were not present. They were not IST/5/-14 meetings.

In that case you are not quoting from the UK C panel but appealing to
anonymous sources holding private, unofficial and presumably unrecorded
discussions. I think that the convenor of the BSI C Standards Panel
implying in a public forum that this was the official position of
IST/5/-14 is cause for serious concern.
Perhaps it is you that does not understand which is why you voted the
opposite way to every one else on the last vote?

For the record the UK's reason for a negative vote is being challenged
by WG14 as being inappropriate and not meeting the requirements for a
'no' vote.
That is the end of this conversation.

In a public forum that has no meaning.
 
F

Francis Glassborow

Chris Hills said:
Not at all. They were VERY clear and explicit about it. This has been
amplified by some of the more experienced members at other meetings
where you were not present. They were not IST/5/-14 meetings.

Perhaps it is you that does not understand which is why you voted the
opposite way to every one else on the last vote?

There is an alternative explanation, none of the others who cast votes
had regularly attended the WG14 meetings responsible for the TR for
embedded C and most did not even attend the meeting held in the UK last
April. They apparently voted 'no' not on the basis of the document in
question but because they dislike another document but see no reason to
actually do any work detailing their objections to that document let
alone making proposals as to how it might be fixed.
 
R

Ross Ridge

Ross said:
Call it what you want, willful non-conformance or not, but no vendor
has released a complete implementation that claims C99 conformance.

Douglas A. Gwyn said:
That's not true. SGI has a compiler they advertise as conforming
to the 1999 C standard.

I stand corrected then.

Ross Ridge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top