Prototype:
unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base);
unsigned long long strtoull(FAR const char *nptr, FAR char **endptr, int base);
If endptr is not NULL, strtoul()/strtoull() should store the address of the first
invalid character in *endptr. And if the correct value is outside the range of
representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set
to [ERANGE].
With such code:
strtoul("34592348345343453453455645765736575865767", &endptr, 10);
It indeed returns ULONG_MAX and sets errno to ERANGE. But after strtoul
return, endptr points to "3455645765736575865767", not NULL.
Signed-off-by: Sunny <zxcvbnm37425@gmail.com>
When we use libmetal with other headers using stdatomic.h, we'll get
symbol conflict if we don't enable HAVE_STDATOMIC_H in libmetal. The
best solution might be using cmake to detect headers automatically, but
we can't. Fortunately we have CONFIG_HAVE_ATOMICS macro now, which can
replace HAVE_STDATOMIC_H when we're not using cmake.
Note: 2-Steps to use CONFIG_HAVE_ATOMICS
1. Include compiler.h for CONFIG_HAVE_ATOMICS definition
2. Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
armv8-m/arm_securefault.c:69:3: warning: implicit declaration of function 'syslog_flush'; did you mean 'syslog_like'? [-Wimplicit-function-declaration]
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
For "%e" conversion, the exponent always contains at least two digits.
That means if the value is zero, the exponent is 00, not 0.
Such as code:
printf(buffer, sizeof(buffer), "%e", 1.232323232323);
printf(buffer, sizeof(buffer), "%e", 12.32323232323);
printf(buffer, sizeof(buffer), "%e", 123.2323232323);
Expected output:
1.232323e+00
1.232323e+01
1.232323e+02
But real output:
1.232323e+0
1.232323e+1
1.232323e+2
Signed-off-by: Sunny <zxcvbnm37425@gmail.com>
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)
------------------
How to test
From within nuttx/. Configure:
cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja
(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja
This uses ninja generator (install with sudo apt install ninja-build). To build:
$ cmake --build build
menuconfig:
$ cmake --build build -t menuconfig
--------------------------
2. cmake/build: reformat the cmake style by cmake-format
https://github.com/cheshirekow/cmake_format
$ pip install cmakelang
$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done
Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>