[Novalug] C compilers

James Ewing Cottrell 3rd JECottrell3@Comcast.NET
Fri Apr 9 22:57:40 EDT 2010


I was gonna reply to this earlier, but I wanted to see whether exception 
handling was in C++ back when C++ was just cfront. It wasn't.

I'm gonna say that it is probably rather difficult to add catch/throw to 
C either as macros (almost impossible), or even deliberately as a user.

You could try using a stack of jmpbufs for setjmp/longjmp, but then 
you'd have to check for returns in the middle of functions, etc.

I dunno, maybe the GNU people have put versions of 
catch/throw/unwind-protect in their libc...altho I don't see one offhand.

As for the 'overhead of object orientation', there really isn't much, 
except when you get polymorphic...and inheritance has fallen out of 
favor anyway.

Besides, the way C preprocessing is done is incredibly inefficient. 
Rather than use "require", they use "include" and ifdef away what they 
have already seen. This is incredibly stupid...as the Standards bodies 
had the chance to fix it. Things like types.h can get included 10 (and 
ignored 9) or more times in just one compilation!

JIM

Bryan J Smith wrote:
> On Tue, 2010-03-30 at 20:56 -0700, Walt Smith wrote:
>> My ideal C compiler is one that does what most already do ...
>> BUT -- this C would also will offer exception processing 
>> ( try-catch )   without the added overhead of OOP , or to be 
>> more specific, without C++ "stuff" ...
>> Would the right combination of options presented to gcc
>> provide the spec ?  Example ?
> 
> Just build a pre-processor then.  Without all the classes and other
> components, it probably wouldn't be difficult to add the exception and
> other event handling.
> 
> And although it's not C, don't forget about Objective-C.  Many people
> still prefer Objective-C for such features, instead of C++.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.791 / Virus Database: 271.1.1/2776 - Release Date: 03/28/10 14:32:00
> 



More information about the Novalug mailing list