Macros are evil

After months of on-again off-again research I’ve reached the point where I can start coding in earnest.  The first problem to tackle are the macro-functions (min, abs, round).  They have undesirable side-effects; some details are available here.. http://arduino.cc/forum/index.php/topic,84364.0.html

The goal with Tiny Core Version 2 is “always choose tiny”.  When more than one implementation is available, choose the one that produces less code.

With abs the built-in functions produce less code so inline functions and overloading are the better choice.

round is the name of a Libc function.  Because of the name conflict, the old macro has caused problems… http://code.google.com/p/arduino-tiny/issues/detail?id=29  I have not been able to create a clean solution so round has been removed.

bperrybap provided the best solution for the remaining macro-functions… http://arduino.cc/forum/index.php/topic,84364.msg640438.html#msg640438

Leave a Reply