visual C++ 6

I

Ioannis Vranos

A bit off topic, but does anyone know if Visual C++ 6 supports the
9899:1995, or only the 9899:1990?
 
R

Richard Heathfield

Andy G. said:
What are the differences between the two?

As far as I can recall, all that C95 added was <iso646.h> - which, again as
far as I recall, VC6 doesn't provide (but I could be wrong about that, of
course).
 
M

muntyan

A bit off topic, but does anyone know if Visual C++ 6 supports the
9899:1995, or only the 9899:1990?

Visual Studio swprintf() is not the standard one, no idea
what else is incompatible. Just forget about C95; it is not
C90 plus wide char api, it's C99 minus VLA. I suppose you
don't want C99 for obvious reasons yet you need wide char
api so you think you want C95; if it's really the case
then C90 *plus* visual studio CRT is quite enough, you
won't use wide char api on unix anyway.

Regards,
Yevgen
 
K

Keith Thompson

Richard Heathfield said:
Andy G. said:

As far as I can recall, all that C95 added was <iso646.h> - which,
again as far as I recall, VC6 doesn't provide (but I could be wrong
about that, of course).

The 1995 amendment (ANSI/ISO/IEC 9899-1990/AM 1-1995) makes the
following changes to C90:

Adds digraphs
<: :> <& &> %: %:%:
as synonyms for
[ ] { } # ##

Updates __STD_VERSION__ to 199409L

Adds <iso646.h>, required for both freestanding and hosted
implementations

Adds <wctype.h> and <wchar.h>, required only for hosted
implementations

Adds EILSEQ to <errno.h>

Makes some adjustments to the description of <stdio.h> to allow
for wide characters.
 
I

Ioannis Vranos

Andy said:
What are the differences between the two?

In summary, bug fixes to C90 + 3 new standard header files: <wchar.h>,
<wctype.h> and <iso646.h>.
 
I

Ioannis Vranos

Visual Studio swprintf() is not the standard one, no idea
what else is incompatible. Just forget about C95; it is not
C90 plus wide char api, it's C99 minus VLA.


I think you are wrong. C95 is Amendment 1 of C90. Nothing to do with the
new stuff of C999, like long long, builtmin complex types etc.

The wide-character version of printf() in C95 is wprintf() declared in
wchar.h, and the rest of the new wide-character support is <wctype.h>
that provides the wide-character equivalents of the <ctype.h> facilities.
 
I

Ioannis Vranos

Corrected some typos:

Ioannis said:
I think you are wrong. C95 is Amendment 1 of C90. Nothing to do with the
new stuff of C99, like long long, built-in complex types etc.
 
I

Ioannis Vranos

Richard said:
As far as I can recall, all that C95 added was <iso646.h> - which, again as
far as I recall, VC6 doesn't provide (but I could be wrong about that, of
course).


Actually VC++ 6 doesn't complain when I #include all of <wchar.h>,
<wctype.h> and <iso646.h>. I am not sure it supports C95 completely though.
 
K

Keith Thompson

Visual Studio swprintf() is not the standard one, no idea
what else is incompatible. Just forget about C95; it is not
C90 plus wide char api, it's C99 minus VLA. I suppose you
don't want C99 for obvious reasons yet you need wide char
api so you think you want C95; if it's really the case
then C90 *plus* visual studio CRT is quite enough, you
won't use wide char api on unix anyway.

C95 is *much* closer to C90 than it is to C99. In other words, the
C99 standard added much more to the language than the C95 amendment
did.

C95 really is just C90 plus the wide character API, plus a couple of
other very minor changes.
 
S

santosh

Keith Thompson wrote:

C95 is *much* closer to C90 than it is to C99. In other words, the
C99 standard added much more to the language than the C95 amendment
did.

C95 really is just C90 plus the wide character API, plus a couple of
other very minor changes.

In fact C95 is so close to C90 that, AFAICS, gcc does not support
conformance to C90, only to C95.
 
K

Keith Thompson

santosh said:
Keith Thompson wrote:


In fact C95 is so close to C90 that, AFAICS, gcc does not support
conformance to C90, only to C95.

According to the documentation, gcc has separate command-line options
for conformance to C89/C90, to C95, and to C99 (the latter is
incomplete).
 
M

muntyan

C95 is *much* closer to C90 than it is to C99. In other words, the
C99 standard added much more to the language than the C95 amendment
did.

C95 really is just C90 plus the wide character API, plus a couple of
other very minor changes.

Yep. But if you look at conformance of popular compilers
(== "visual studio") then C95 is C99 minus VLA, that is,
not supported.
I guess "VLA" doesn't quite mean all language changes
from C99, but it doesn't really matter ;)

Yevgen
 
I

Ioannis Vranos

Yep. But if you look at conformance of popular compilers
(== "visual studio") then C95 is C99 minus VLA, that is,
not supported.
I guess "VLA" doesn't quite mean all language changes
from C99, but it doesn't really matter ;)


Visual C++ 2008 supports C95 100%.
 
M

muntyan

Visual C++ 2008 supports C95 100%.

You are right, according to MSDN Visual Studio 2005
and newer conform to C95, and you need to define
_CRT_NON_CONFORMING_SWPRINTFS to get the old non-C99
swprintf. Does someone know if the next C++ standard
is going to have C99-compatible variadic macros and
VLA? If it is, then perhaps MS will support C99 too,
some day.

Yevgen
 
S

santosh

(e-mail address removed) wrote:

[ ... ]
Does someone know if the next C++ standard
is going to have C99-compatible variadic macros and
VLA? [ ... ]

You should probably enquire in comp.std.c++, but I doubt this. The web
references that I have read have not mentioned C99's variadic macros or
VLA. C++'s philosophy is to minimise preprocessor use in favour of
templates.
If it is, then perhaps MS will support C99 too,
some day.

Yes, the same day that pigs will start taking to the air. :)
 
I

Ioannis Vranos

You are right, according to MSDN Visual Studio 2005
and newer conform to C95, and you need to define
_CRT_NON_CONFORMING_SWPRINTFS to get the old non-C99
swprintf. Does someone know if the next C++ standard
is going to have C99-compatible variadic macros and
VLA? If it is, then perhaps MS will support C99 too,
some day.


The approach taken by the C++ committee, is that C++ is a
library-programming language in addition to systems programming and
applications programming.

More specifically, for example C++ provides a complex type in its
standard library that can be implemented by using the language itself.
This is also the case for a dynamic array named vector, and for serious
space/run-time constraints valarray.

So the focus is to enable the language to do things, rather than adding
"exotic" facilities.

Regarding macros, AFAIK they are deemed unnecessary, but of course it
provides the preprocessor of C95. C++ provides newer facilities than the
C ones, to do the same job. Templates are considered a better and less
dangerous alternative than macros.

VLAs are provided in the form of vector/valarray and other standard
library containers in C++.
 
K

Keith Thompson

Yep. But if you look at conformance of popular compilers
(== "visual studio") then C95 is C99 minus VLA, that is,
not supported.
I guess "VLA" doesn't quite mean all language changes
from C99, but it doesn't really matter ;)

Um, yes, it does matter. Either I've completely failed to understand
your point, or you're wrong. (Or I'm wrong.)

C95 added just a few features to C90, most notably the wide character
API.

C99 added a large number of new features to C95; VLAs are just one of
them.

C90 is very nearly C95 minus wide characters. C95 is *not* very
nearly C99 minus VLAs; it's C99 minus VLAs, minus flexible array
menbers, minus variadic macros, minus type-generic math, minus math
functions for float and double, minus complex numbers, minus long
long, minus <inttypes.h> and <stdint.h>, minus compound literals,
minus // comments, minus mixed declarations and statements, minus
inline functions, minus a whole list of other features, plus implicit
int.

If a given implementation happens to fully implement neither C95 or
C99, that doesn't imply that the two versions of the language are
particularly close.

With which of the above statements are you disagreeing?
 
R

Richard Bos

Yep. But if you look at conformance of popular compilers
(== "visual studio") then C95 is C99 minus VLA, that is,
not supported.

If you look only at the conformance of M$ Visual Studio++#,

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)

is good and proper C.

What Visual Studio accepts says sweet Fanny Adams about what C really
_is_.

Richard
 

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top