Re: Where to get a compatibility list of C and C++?



websnarf@xxxxxxxxx wrote:
> Rob Thorpe wrote:
> > websnarf@xxxxxxxxx wrote:
> > > Aladdin wrote:
> > > > Thanks a lot. I'm working on a compiler and constructing some
> > > > testcases.
> > > >
> > > > I'm looking for the feature ***supported in C but not in C++***.
> > >
> > > Oh that's easy; there are none.
> >
> > There are several. Try porting a C program to C++ and you'll soon find
> > them.
>
> Been doing this off and on for years. Haven't encountered any such
> phantom features so far.

long long is another that someone else mentioned.

> > > > Because C++ is designed back-compatible with C, such features may be
> > > > exceptional. But I know they exists, e.g. legacy language features.
> > >
> > > There are differences, but no drop in features. Unless you consider
> > > things like a seperate struct name space as actually a feature.
> >
> > The semantics of void * are different in C to C++. In C++ void* must
> > often be cast, but not in C. I consider the C semantics more useful.
>
> Yes, but I don't call that a *FEATURE*.

I suppose it depends on how small a thing you call a feature.

I once ported an interpreted language from C to C++. It used a great
number of void pointers to deal with functions in the C library that
the language called. Porting it to C++ made it slightly longer and
more difficult to read. In that, very unusual, case it was definitely
a feature.

.