[fpc-devel] AVR RTL error handling conventions

Christo christo.crause at gmail.com
Sun Jul 16 13:02:39 CEST 2017


Greetings from a newby to this list.  I'm working on division routines
for the AVR embedded target and have been wondering what error handling
convention is used in the embedded AVR RTL.  At the moment the
algorithm I'm using automatically returns max_size for unsigned
division by zero and I don't have any checks because the code will run
for a fixed number of iterations, then return. 

I see that the generic div/mod routines call HandleErrorAddrFrameInd,
but this generates a lot of extra code, and it eventually calls halt,
which seems to end in an endless loop in _haltproc.

I would think halting firmware on error is probably not always desired,
so should I follow avr-gcc which also doesn't have error handling (at
least not with default compiler settings)? 



More information about the fpc-devel mailing list