Gregory Nutt
d7586c27a5
libs/libc/stdio/Kconfig: Add 'range 9 999999' to CONFIG_LIBC_NL_ARGMAX. Per OpenGroup.org, the minimum value for NL_ARGMAX is 9.
2019-02-21 14:04:46 -06:00
Gregory Nutt
533fd0636e
libs/libc/lib_libvsprintf.c and Kconfig: Remove CONFIG_LIBC_PRINT_MINIMAL. The output in that configuration is unsatisfactory and inappropriate for use with NuttX. For example, the output from many NSH commands become corrupted and useless. Doesn't belong in this context.
2019-02-21 13:53:34 -06:00
Johannes
0059a5a88e
libs/libc/stdio/lib_vsprintf.c and Kconfig:
...
- Numbered arguments now work by using two pass parsing and an argument list.
The maximum number of numbered args is determined by CONFIG_LIBC_NL_ARGMAX
which is then copied into NL_ARGMAX.
- Size of pointer argument ('p') is determined before output.
include/limits.h: Define NL_ARGMAX (as well as some of the other 'invariant
values' per http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html )
2019-02-21 13:26:33 -06:00
Gregory Nutt
05a68d175b
libs/libc/stdio/Kconfig: CONFIG_LIBC_NUMBERED_ARGS now depends on EXPERIMENTAL. Per Johannes: I tested numbered arguments on i.mx rt 1050, and it isn't working. Only on Linux/MSYS 64bit all relevant data types are size 8 bytes, and therefore my loop through the arg list is working. On 32bit systems, all is 4 bytes except floating point variables which is implicit 8 byte double.
2019-02-20 08:00:35 -06:00
Johannes
77aa1f1179
libs/libc/stdio/Kconfig: Need to guard LIBC_NUMBERED_ARGS against LIBC_LEGACY_PRINTF
2019-02-18 15:26:41 -06:00
Johannes
698d942f8d
libs/libc/stdio/lib_libvsprintf.c: Adds configurable support for numbered arguments.
2019-02-18 11:51:22 -06:00
Gregory Nutt
76a2f6c2a2
libs/libc/stdio: This commits makes the nano-printf the defualt logic for the printf family. The legacy printf is still available via CONFIG_LIBC_PRINT_LEGACY. This commit also modifies the nano-prinf configure: The PRINT_LEVEL is not long selectable. Instead, a not CONFIG_LIBC_PRINT_MINIMAL boolean setting was added and the PRINT_LEVEL is derived from a combination of CONFIG_LIBC_PRINT_MINIMAL, CONFIG_LIBC_FLOATINGPOINT, and CONFIG_LIBC_LONG_LONG.
2019-02-17 12:29:20 -06:00
Johannes
41a4a40879
libs/libc/stdio/nano_libvsprintf.c: Add long long support. CONFIG_LIBC_LONG_LONG needs at least CONFIG_NANO_PRINTLEVEL 2. Code size for compile without CONFIG_LIBC_LONG_LONG shouldn't be affected.
2019-02-15 19:10:40 -06:00
Gregory Nutt
4dc0636f1e
libs/libc/stdio: Add support for %g format which, for these purpose, is equivalent to %f except that trailing zeroes are suppressed.
2019-02-15 11:45:25 -06:00
Gregory Nutt
5739179109
Upate Kconfig comments
2019-02-15 10:04:57 -06:00
Gregory Nutt
38e93ede2b
Revert "libs/libc/stdio: Fix the %f floating point output format."
...
The previous implementation was probably corect. On Cygwin with GCC I see this:
int main(int argc, char **argv)
{
printf("Value 1.2 is: [%f]\n", 1.2);
printf("Value 0.1 is: [%f]\n", 0.1);
printf("Value 0.0: [%f]\n", 0.0);
printf("Value 347.6872: [%f]\n", 347.6872);
}
Generates output
Value 1.2 is: [1.200000]
Value 0.1 is: [0.100000]
Value 0.0: [0.000000]
Value 347.6872: [347.687200]
This reverts commit eb0223bc7f
.
2019-02-15 10:01:44 -06:00
Gregory Nutt
eb0223bc7f
libs/libc/stdio: Fix the %f floating point output format.
2019-02-15 09:56:58 -06:00
Gregory Nutt
6a30e22ad4
Update a README; improvie some Kconfig defaults.
2019-02-09 12:19:32 -06:00
Gregory Nutt
7ac9bd671b
libs/libc/stdio/Kconfig: Update some help comments.
2019-02-07 18:47:27 -06:00
Gregory Nutt
adf28d8903
libs/libc/stdio/Kconfig: CONFIG_NANO_PRINTF should depend on CONFIG_LIBC_LONG_LONG=n. Default should be y if CONFIG_DEFAULT_MALL=yi (as suggested by Alan Carvalho de Assis).
2019-02-07 17:37:43 -06:00
Keith Packard
e05149b745
libs/libc/stdio: Add newlib-nano fprintf as an option. This fprintf code was originally adapted from AVR libc and provides improved floating point output support, including 'g' mode and making 'f' mode include digits past the decimal by default. However, this version does not have any long long support. On a demonstration cortex M4 build, this version saves about 5kB of ROM. The newlib version can be found here: https://salsa.debian.org/electronics-team/toolchains/newlib-nano . That project is GPL overall, but the newlib-nano printf portions are BSD licensed as described in the COPYING.NEWLIB file.
2019-02-06 15:50:52 -06:00
Gregory Nutt
efe2ff3933
libs/libc/stdio/Kconfig: Commit d0254b1c79
removed all usage of CONFIG_NOPRINTF_FIELDWIDTH but failed to remove the selection from the Kconfig file.
2018-10-06 10:33:29 -06:00
Alan Carvalho de Assis
283b73edc5
Fix lots of typos in C comments and Kconfig help text
2018-07-08 18:24:45 -06:00
Gregory Nutt
cf99fb40c9
This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now.
...
Squashed commit of the following:
libs/libxx: Fix some confusing in naming. If the directory is called libxx, then the library must be libxx.a (unless perhaps LIBCXX is selected).
libs/: Fix paths in moved library directories.
libs: Brute force move of libc, libnx, and libxx to libs. Cannot yet build it in that configuration.
2018-05-29 13:21:26 -06:00