libc/stdio: in dtoa(), up_interrupt_context() is used in a debug assertion. up_interrupt_context() is not available in the user-mode phase of the PROTECTED or KERNEL build configurations. In those configurations, enabling libc floating point support and debug assertions will result in an undefined reference to up_interrupt_context().

This commit is contained in:
Gregory Nutt 2018-02-01 07:37:16 -06:00
parent be81893b55
commit e93cb86903

View File

@ -138,6 +138,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
int dsgn; /* Unused sign indicator */
int i;
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
/* This function may *NOT* be called within interrupt level logic. That is
* because the logic in __dtoa may attempt to allocate memory. That will
* lead to cryptic failures down the road within the memory manager.
@ -146,6 +147,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
*/
DEBUGASSERT(up_interrupt_context() == false);
#endif
/* Special handling for NaN and Infinity */