wouter van ooijen voti.nl> writes: > Maybe I should not react to this, but here I go... > > >> exception handling => safety critical stuff > > > > exception handling => race condition on small micro > > a "race" condition is something very important indeed. A race appears when an exception is thrown and interrupts are on, if there is more than one path to the exception handler and/or there are unguarded variables used by the throw mechanism. There is no inherent mechanism in the try/throw/catch paradigm that guarantees it to work other than in a single threaded environment. Either that or the task must be fully reentrant and that requires a full stack frame of usually large size. Afaik no such thing exists on PICs (excepting on the largest ones). > But I assume you meant "rare"? You did a lot of automibile, military, > nuclear, and space projects? Ever programmed for ESA? No, not at all. Are any PICs used in European missiles ? ;-) > Ever programmed in a language that had exception handling, so you could > appreciate it? Yes, C++ and a little of others. But I did not feel like abusing it. > > > templates => flexible libraries (reduces development costs) > > > > flexible libraries with C++ calling conventions => huge > > memory and code overhead, high library porting and maintenance cost > > I dunno about C++ calling conventions (multiple?), C++ can call by C > convention if you want. C++ allows full virtual methods as you know. These need to be instantiated at runtime i.e. a good part of the linker must be compiled into the program. And it has to be fully reentrant and thread-safe in an interrupted environment with no memory protection. I don't even want to think about what that would look like, although I'm sure it can be done. > If you meanr 0.3 to 3.0 times *more*: bullocks. Take your C code, pass > it through a C/C++ compiler in C++ mode and get the same assembly as in > C mode. After that, see what could be done better with C++ constructs > and start saving code. I think that C++ excels precisely at what is 'forbidden' on micros due to limited resources. Other than that, you are right. So basically you's use C++ without most convenient C++ features. Whatever is good for you. Peter P. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist