Commit Graph

126 Commits

Author SHA1 Message Date
Gregory Nutt
72bc331217 Cosmetic update to some comments. 2019-02-15 18:26:06 -06:00
Gregory Nutt
c271151d57 libs/libc/stdio: Remove unused, non-standard functions lib_sscanf() and lib_sprintf(). 2019-02-15 18:01:39 -06:00
Gregory Nutt
928108036c libs/libc/stdio: In the recent changes we lost the implementation of vsscanf(). This commit restores vsscanf(). sscanf() is not just a front end for vsscanf(). 2019-02-15 17:31:58 -06:00
Gregory Nutt
d0bd4c959d arch/arm/src/tiva/hardware/tiva_ssi.h: Fix typo error found in build testing. libs/libc/stdio/lib_libsscanf.c: Fix warnings found in build testing. 2019-02-15 14:38:06 -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
Johannes
7b9d02d496 libs/libc/stdio/lib_libvsprintf.c: No precision specifier resulted in precision 0 but should be precision 6. 2019-02-15 08:42:07 -06:00
Gregory Nutt
b8c7e5fcc0 Minor fixes to some spacing. 2019-02-14 15:57:15 -06:00
Johannes
479363ae3b libs/libc/stdio/lib_libsscanf.c: Initialized the lastc pointer to avoid the checks for NULL. Removed a bug in the floating point parsing which allowed several signs after each other. 2019-02-14 15:43:21 -06:00
Johannes
350295d009 Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org>

    TODO:  Remove 'Missing fscanf()' bug
    Clean up remaining complaints for tools/nxstyle
    Apply tools/detab, rmcr, convert-comments, lowhex, and indent.sh to the new and highly modified files.

Author: Johannes <nivus.entwicklung@gmail.com>

    - Move vscanf logic to lib_sscanf.c  Switched to stream interface (tricky, because the old implementation used massive read ahead, which isn't suitable for streams, chars already read are gone).
    - Added scanf and fscanf
    - Added hh, h, and ll modifiers
    - Fixes for standard compliance in scanf
    - Fixes for standard compliance in strto... function family (don't consume single '-' or '+', allow sign in strotul(l))
2019-02-14 07:03:02 -06:00
Gregory Nutt
efe65749ce Fix condition logic: The setup seems to support a network without sockets. That is not the case.
Squashed commit of the following:

    sched/sched/sched_getsockets.c:  Fix an error in conditional compilation.
    fs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NSOCKET_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    syscall/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    tools/:  Fixups for CONFIG_NSOCKET_DESCRIPTORS no longer used to disable sockets.
2019-02-11 15:47:25 -06:00
Gregory Nutt
a64869aa67 CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file system. NuttX with no file system does not make sense.
Squashed commit of the following:

    configs/:  The few configurations that formerly set CONFIG_NFILE_DESCRIPTORS=0 should not default, rather they should set the number of descriptors to 3.
    fs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    tools/:  Tools updates for changes to usage of CONFIG_NFILE_DESCRIPTORS.
    syscall/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    drivers/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NFILE_DESCRIPTORS == 0
    binfmt/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    arch/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/Kconfig:  CONFIG_NFILE_DESCRIPTORS may no longer to set to a value less than 3
    configs/:  Remove all settings for CONFIG_NFILE_DESCRIPTORS < 3
2019-02-11 12:09:26 -06:00
Gregory Nutt
675a9a170a lib_sscanf.c: Remove some redundancy in debug output. 2019-02-10 07:49:42 -06:00
Gregory Nutt
810b5de41b Update TODO list. 2019-02-10 07:49:25 -06:00
Gregory Nutt
3ba777bb27 include/: Correct naming of standard header file. Should be dlfcn.h, not dllfcn.h. I am surprised no one ever noticed before now. 2019-02-09 14:09:28 -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
Alan Carvalho de Assis
38508e72b9 libs/libc/stdio/nano_libvsprintf.c: Remove not used sign variable that was stopping the compilation 2019-02-07 16:48:38 -06:00
Gregory Nutt
e5ea84c1ff libs/libc/stdio: A few more coding standard fixes for nano-printf file: all global data names must begin with g_. All structure names must end with _s. 2019-02-06 17:05:01 -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
Xiang Xiao
659852acd5 libs/libc/unistd/lib_getopt.c: Add logic to reinitialize the stale context for the FLAT/PROTECTED builds. In these builds getopt() global varriables may be shared by many tasks. If any task exits the getopt() loop before all command line arguments have been parsed, then getopt() global variables will be left in a bad state. The next time getopt() is called, this logic should detect the bad state and force the state of getopt() to be re-initialized so that it can be reused. This logic is not full proof (it would fail, for example, if you tried to parse the same command line twice) but should catch the typical misuse cases. 2019-02-05 10:30:59 -06:00
Xiang Xiao
964f0ab304 aio_cancel need signal caller after the succeed and fix minor issue in the error handler 2019-01-27 09:39:33 -06:00
Xiang Xiao
fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Gregory Nutt
7dd81cc5c2 libs/libxx/Kconfig: utomatically select CONFIG_LIBC_WCHAR and CONFIG_TIME_EXTENDED when CONFIG_LIBCXX is selected since libcxx compile fails if without these two option 2019-01-27 07:00:07 -06:00
Xiang Xiao
dc8013ab76 Remove the unused libs/libc/endian/Kconfig 2019-01-27 06:58:01 -06:00
Xiang Xiao
16850297f3 libs/unistd and other affected files: Hostname support no longer depends on CONFIG_NET since the host name is also useful in the non-network environment. CONFIG_NET_HOSTNAME changed to CONFIG_LIB_HOSTNAME. 2019-01-27 06:56:16 -06:00
Gregory Nutt
c40daffb5b libs/libc/misc/lib_utsname.c: Add build date and time to uname output (like Linux). 2019-01-27 06:24:24 -06:00
ligd
d6740a6678 libs/libc/stdio/lib_libvsprintf.c: Correct justification for alternate forms of %p and %P 2019-01-27 06:22:01 -06:00
Alan Carvalho de Assis
db0b9b7c34 arch/arm/src/samd2l2 serial: Fix SAMD2L2 serial driver it needs sam_usart_enable() to work 2019-01-26 12:51:51 -06:00
Xiang Xiao
8763e51583 libs/libc/symtab/symtab_findorderedbyvalue.c: Remove unused symtab_findorderedbyvalue. 2019-01-26 12:42:30 -06:00
Xiang Xiao
8812a3315d libs/libc/machine/arm: Fix the minor issue in libc arm machine folder; MOVW/MOVT should use zero(not sign) extension. 2019-01-26 11:59:27 -06:00
anchao
98add65c14 libs/libc/machine/arm/armv7-m/arch_elf.c: Add support for the R_ARM_THM_JUMP11 relocation type. This relocation type may be generated when LTO optimization is enabled. 2019-01-26 11:52:57 -06:00
Xiang Xiao
c43e4673ab sched/Kconfig, libs/libc/dllfcn/Kconfig, libs/libc/modlib/Kconfig: Refine ELF related configurations. 2019-01-26 11:50:09 -06:00
anchao
88efb84847 libs/libc/dllfcn, sched/init: Add LD_LIBRARY_PATH environment variable support. 2019-01-26 11:47:14 -06:00
Xiang Xiao
9e2238f6cd libs/libc/dllfcn: Implement dlerror using strerror. 2019-01-26 11:39:05 -06:00
Xiang Xiao
0edcd6b85e binfmt/libelf, libs/libc/modlib: Optimize elf load speed: (1) Don't zero out memory, (2) Reduce the initial buffer size to 32 bytes. 2019-01-26 11:34:40 -06:00
Xiang Xiao
38ffb98f1b Kconfig files, binfmt/libelf, libs/libc/machin, libs/libxx: Correct libcxx exception handling by introducing the generic config(CXX_EXCEPTION and CXX_LIBSUPCXX) 2019-01-26 11:23:31 -06:00
Xiang Xiao
095e28d45e binfmt/, binfmt/libelf/, include/nuttx, libs/libc/machine, libs/libc/modlib, and others: Move elf related arch function to include/nuttx/elf.h because the implementation is located in libs/libc/machine and in order to avoid the conflict with the 3rd party libraries and clean up the file inclusion: (1) Remove redundant elf32.h, (2) Remove nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in modlib. 2019-01-26 11:18:45 -06:00
Gregory Nutt
3def509f4e libs/libc/stdio/lib_libfread.c: fread() should always set EOF if fewer than the requested number of bytes was not read. Per Anthony Merlino. 2018-12-07 12:18:40 -06:00
David Sidrane
5433ec589b fs/driver/fs_blockpartition.c: Fix void pointer warning.
libs/libc/unistd/lib_daemon.c:  Fix compiler error is streams disabled.
sched/irq/irq_procfs.c:  Fix warning
sched/task/task_vfork.c: Fix void * math warning
2018-12-03 17:54:21 -06:00
Mateusz Szafoni
d2b98cc150 Merged in raiden00/nuttx_pe (pull request #771)
Use STM32 DMA IP core version instead of chip family names and some minor improvements

arch/arm/src/stm32/chip/stm32_adc.h: raise error if two IP cores seleceted

libs/libdsp/Kconfig: cosmetic change

arch/arm/src/stm32/Kconfig: hide TIMER menu, HRTIM menu and USB Host debug menu if peripherals not enabled

configs/stm32f429i-disco/highpri/defconfig: fix configuration warning

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-02 11:49:25 +00:00
Juha Niskanen
3e7281e699 libs/libc/netdb: Support multiple IP addresses per hostname 2018-11-23 07:09:47 -06:00
uha Niskanen
23aa2839c3 libs/libc/netdb/lib_dnsquery.c: harden against DNS spoofing. This commit implements most of the RFC 5452 guidelines for making DNS more resilient. We now verify response matches against what was queried and use unpredictable query IDs. It is also checked that response come from correct DNS server. Also fixes a buffer overflow when querying hostnames longer than CONFIG_NETDB_DNSCLIENT_NAMESIZE. 2018-11-16 06:56:45 -06:00
Juha Niskanen
5129e4dd60 ibs/libc/netdb: Make DNS retries configurable 2018-11-14 06:30:49 -06:00
Gregory Nutt
1a754deaa0 Cosmetic updates from review of last PR. 2018-11-12 09:43:33 -06:00
Petteri Aimonen
fe0532c226 Merged in paimonen/nuttx/pullreq_libc_libnx_updates (pull request #757)
Pullreq libc libnx updates

* NuttX: make strerror() return 'Success' for 0

* NuttX: fix strrchr() so that it considers null terminator as part of string

    From strrchr(3) man page:
    "The terminating null byte is considered part of the string, so that if c
    is specified as '\0', these functions return a pointer to the terminator."

* NuttX: mm_free(): Add DEBUGASSERT()'s to catch memory corruption early.

    It's easier to find the source when asserts fail already when freeing
    an overflowed buffer, than if the corruption is only detected on next
    malloc().

* MM_FILL_ALLOCATIONS: Add debug option to fill all mallocs()

    This is helpful for detecting uninitialized variables,
    especially in C++ code. I seem to be forgetting to initialize
    member variables and then they just get random values..

* NuttX: nxtk_bitmapwindow: Fix warning message when bitmap is fully off-screen.

* nxfonts_getfont: Avoid unnecessary warnings for other whitespace chars also.

* NuttX: Fix kerning of 'I' in Sans17x22 font

    The I character was running together with some other
    characters, e.g. in sequence "IMI".

* NXMU: Revalidate window pointer for mouse events.

    NXMU caches the previous window pointer so that further mouse
    events can be sent to the same window. However, if the window
    is destroyed while mouse button is held down, the pointer may
    become invalid and cause a crash. This patch revalidates the
    pointer before using it.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-11-12 15:36:35 +00:00
ligd
4a8b750ecd ibs/libc/net: Add basic implementation for recvmsg and sendmsg per OpenGroup.org specification. 2018-11-09 11:39:05 -06:00