mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Add an option to disable support for long long formats in lib_vsprintf. From Alan Carvalho de Assis
This commit is contained in:
@@ -48,6 +48,19 @@ config LIBC_FLOATINGPOINT
|
||||
By default, floating point
|
||||
support in printf, sscanf, etc. is disabled.
|
||||
|
||||
config LIBC_LONG_LONG
|
||||
bool "Enable long long support in printf"
|
||||
default y if !DEFAULT_SMALL
|
||||
default n if DEFAULT_SMALL
|
||||
---help---
|
||||
Enables support for long long formats in printf, sscanf, etc. is
|
||||
enabled. This is enabled by default but if you are trying to
|
||||
reduce the FLASH footprint, then disabling this feature is one
|
||||
option. The FLASH saves comes not from disabling the long long
|
||||
formats, but rather from omitting the large long long arithmetic
|
||||
libraries that will be drawn into the build if long long support
|
||||
is enabled.
|
||||
|
||||
config LIBC_IOCTL_VARIADIC
|
||||
bool "Enable variadic ioctl()"
|
||||
default n
|
||||
|
||||
@@ -182,7 +182,7 @@ static int getlusize(uint8_t fmt, FAR uint8_t flags, unsigned long ln);
|
||||
|
||||
/* Unsigned long long int to ASCII conversions */
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_LIBC_LONG_LONG)
|
||||
static void llutodec(FAR struct lib_outstream_s *obj, unsigned long long lln);
|
||||
static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long lln, uint8_t a);
|
||||
static void llutooct(FAR struct lib_outstream_s *obj, unsigned long long lln);
|
||||
@@ -805,7 +805,7 @@ static int getlusize(uint8_t fmt, uint8_t flags, unsigned long ln)
|
||||
#endif /* CONFIG_NOPRINTF_FIELDWIDTH */
|
||||
#endif /* CONFIG_LONG_IS_NOT_INT */
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_LIBC_LONG_LONG)
|
||||
/****************************************************************************
|
||||
* Name: llutodec
|
||||
****************************************************************************/
|
||||
@@ -1426,7 +1426,7 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
|
||||
|
||||
if (strchr("diuxXpob", FMT_CHAR))
|
||||
{
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_LIBC_LONG_LONG)
|
||||
if (IS_LONGLONGPRECISION(flags) && FMT_CHAR != 'p')
|
||||
{
|
||||
long long lln;
|
||||
|
||||
Reference in New Issue
Block a user