[vorbis-dev] Building vorbis - please help

Monty xiphmont at xiph.org
Mon Jan 29 22:10:38 PST 2001



> That argument is a rather weak one.  C is very, very close to a proper
> subset of C++.  In early incarnations, it was a proper subset.  C++ was
> originally a series of C macros.

No version of C++ that was widely exposed to the outside world was
ever just a set of macros.  C++ was originally 'C with classes' (ala
CLU) and that can't be accomplished with macros.

>  While C++ is no longer expressible in
> that way, it is still roughly a superset of C.

True enough.

> Thus, well-written C code
> should compile with a C++ compiler, with a handful of minor caveats.

Yes, casts are, semantically, a minor caveat, but practically a big
deal.
 
> First, C++ is particularly picky about casts.  An anal-retentive C
> compiler could also be that picky if it wanted to be, in most cases.
> There's nothing wrong with adding the casts -- no C compiler is going to
> complain -- so it seems reasonable to add them.

AFAIC, Vorbis is not C++; it's C.  Really.  Adding all the necessary
casts from every function that returns memory as a void * makes the
code less readable.  The reason CLU died and C++ took up the Class
mantle is primarily because CLU drowned in its own verbosity.  (Well,
OK, there's also the embarrassing matter of CLU's only compiler being
hand written in VAX assembly for the longest time ;-)

> Those implicit cast warnings are the only problems I had with building ao
> and ogg using g++.  Vorbis, however, is another story, as it just happens
> to hit one of the very tiny places where C isn't a perfect subset,
> specifically the C++ notion of "this".

This isn't C++.  ANSI C is hard enough to make portable, I really
don't have a strong inclination to coddle C++ compilers that are only
pretending to be C compilers unless it's necessary to make the code
compile correctly.

And yes, it's a point primarily based on being ornery.  On a decaf day
I might be convinced otherwise.

Monty

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list