Follow-up Comment #3, patch #6418 (project avr-libc): Rather than generating an error when an integer non-constant is passed the non-exact macros could form a loop around a constant delay.
#define _delay_ms(__ms) do { if (!__builtin_constant_p(F_CPU)) { _DELAY_EMIT_ERROR(__STRINGIFY(F_CPU) " is not a constant for _delay_ms"); } else if (__builtin_constant_p(__ms)) { _delay_f_ms(F_CPU, __ms); } else if ((__typeof__((_ms) + 0))0.25 == 0) { __typeof__((__ms) + 0) __ms2 = __ms; while (__ms2--) _delay_f_ms(F_CPU, 1); } else { _DELAY_EMIT_ERROR(__STRINGIFY(__ms) " is not a constant or integer for _delay_ms"); } } while (0) _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/patch/?6418> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev