Mail Archives: djgpp/2000/02/21/21:25:58
Horst Kraemer wrote:
> And there is no point compiling a valid C program "as C++" although
> since Charles Petzold (in his excellent book "Programming windows")
> recommended compiling C programs "as C++" people ruminate that this is
> GOOD...
Yes there is a point: C++ syntax is more strict, so you'll catch more bugs.
> Imho the only profit you gain is that you have to do the malloc-cast
> which is only a syntactical "ceremony" without any practical
> usefulness.
Wrong, that's a rule that makes the compiler to check your code much better, as
a side effect you must cast malloc.
> But if you prefer C++ then stick to C++ by all means - but don't call
> your programs C programs ;-) C and C++ are distinct languages with a
> lot of similarities. And this "lot" is the dangerous part because it
> makes you forget that there _are_ differences.
Hmmm... you are missing a good option: C code that only uses C++ for the really
needed things.
SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
- Raw text -