casaroli commented on code in PR #21493:
URL: https://github.com/apache/nuttx/pull/21493#discussion_r4492277218


##########
libs/libc/stdio/Kconfig:
##########
@@ -52,9 +52,39 @@ config NUNGET_CHARS
                Number of characters that can be buffered by ungetc() (Only if
                FILE_STREAM equals y)
 
+choice
+       prompt "printf profile"
+       default LIBC_PRINTF_DEFAULT
+       ---help---
+               A profile only sets the defaults of the printf feature options.
+               Each option keeps its own prompt, so any feature can be added to
+               or removed from any profile.
+
+               printf() is safe with a correct call in every profile.  A 
feature
+               that is off still reads its argument at the right size, so the
+               arguments after it stay correct.
+
+config LIBC_PRINTF_MINIMAL
+       bool "Minimal"
+       ---help---
+               The smallest printf.  It has less than the Default profile.
+
+config LIBC_PRINTF_DEFAULT
+       bool "Default"
+       ---help---
+               The features that printf has always had by default.
+
+config LIBC_PRINTF_FULL
+       bool "Full"
+       ---help---
+               All features.
+
+endchoice # printf profile
+
 config LIBC_FLOATINGPOINT
        bool "Enable floating point in printf"
-       default !DEFAULT_SMALL && ARCH_FPU
+       default y if LIBC_PRINTF_FULL
+       default !DEFAULT_SMALL && ARCH_FPU && !LIBC_PRINTF_MINIMAL

Review Comment:
   Done.



##########
libs/libc/stdio/Kconfig:
##########
@@ -52,9 +52,39 @@ config NUNGET_CHARS
                Number of characters that can be buffered by ungetc() (Only if
                FILE_STREAM equals y)
 
+choice
+       prompt "printf profile"
+       default LIBC_PRINTF_DEFAULT
+       ---help---
+               A profile only sets the defaults of the printf feature options.
+               Each option keeps its own prompt, so any feature can be added to
+               or removed from any profile.
+
+               printf() is safe with a correct call in every profile.  A 
feature
+               that is off still reads its argument at the right size, so the
+               arguments after it stay correct.
+
+config LIBC_PRINTF_MINIMAL
+       bool "Minimal"
+       ---help---
+               The smallest printf.  It has less than the Default profile.
+
+config LIBC_PRINTF_DEFAULT
+       bool "Default"
+       ---help---
+               The features that printf has always had by default.
+
+config LIBC_PRINTF_FULL
+       bool "Full"
+       ---help---
+               All features.
+
+endchoice # printf profile
+
 config LIBC_FLOATINGPOINT
        bool "Enable floating point in printf"
-       default !DEFAULT_SMALL && ARCH_FPU
+       default y if LIBC_PRINTF_FULL
+       default !DEFAULT_SMALL && ARCH_FPU && !LIBC_PRINTF_MINIMAL

Review Comment:
   Done.



##########
libs/libc/stream/lib_ultoa_invert.h:
##########
@@ -51,12 +54,30 @@
 #define XTOA_PREFIX  0x0100    /* Put prefix for octal or hex */
 #define XTOA_UPPER   0x0200    /* Use upper case letters */
 
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* The integer that printf() can print */
+
+#if defined(CONFIG_LIBC_PRINTF_LONG_LONG) || ULLONG_MAX == ULONG_MAX
+typedef long long ultoa_int_t;
+typedef unsigned long long ultoa_uint_t;
+#else
+typedef long ultoa_int_t;
+typedef unsigned long ultoa_uint_t;
+
+/* The digit loop works on long, so it needs no 64-bit division method */
+
+#  undef CONFIG_HAVE_EXPRESSION_STATEMENT

Review Comment:
   Done.



##########
libs/libc/stream/lib_ultoa_invert.h:
##########
@@ -51,12 +54,30 @@
 #define XTOA_PREFIX  0x0100    /* Put prefix for octal or hex */
 #define XTOA_UPPER   0x0200    /* Use upper case letters */
 
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* The integer that printf() can print */
+
+#if defined(CONFIG_LIBC_PRINTF_LONG_LONG) || ULLONG_MAX == ULONG_MAX
+typedef long long ultoa_int_t;
+typedef unsigned long long ultoa_uint_t;
+#else
+typedef long ultoa_int_t;
+typedef unsigned long ultoa_uint_t;
+
+/* The digit loop works on long, so it needs no 64-bit division method */
+
+#  undef CONFIG_HAVE_EXPRESSION_STATEMENT

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to