Cynerd opened a new pull request, #19242:
URL: https://github.com/apache/nuttx/pull/19242
## Summary
This fixes the issue discovered with a new versions of GCC:
```
libm/lib_truncl.c: In function 'truncl':
libm/lib_truncl.c:68:14: error: 'u.i.se' is used uninitialized
[-Werror=uninitialized]
68 | int e = u.i.se & 0x7fff;
| ~~~^~~
libm/lib_truncl.c:63:17: note: 'u' declared here
63 | union ldshape u =
| ^
libm/lib_truncl.c:69:14: error: 'u.i.se' is used uninitialized
[-Werror=uninitialized]
69 | int s = u.i.se >> 15;
| ~~~^~~
libm/lib_truncl.c:63:17: note: 'u' declared here
63 | union ldshape u =
| ^
libm/lib_truncl.c:63:17: error: 'u.i.se' is used uninitialized
[-Werror=uninitialized]
```
This was originally submitted in #18480, but that failed to approach the
missing `long double` definitions.
## Impact
The changes were only covered for GCC and Clang. I haven't add definition
for other compilers. Thus this will break compilers that have
`CONFIG_HAVE_LONG_DOUBLE` defined. I put toggether the following list:
* [x] GCC and Clang
* [x] SDCC (undefines `CONFIG_HAVE_LONG_DOUBLE`)
* [x] Zilog (undefines `CONFIG_HAVE_LONG_DOUBLE`)
* [ ] ICCARM
* [ ] MSVC
* [ ] TASKING
Please, can anyone deduce the correct definitions for these compilers?
The second impact is that I added `limits_check.c` to verify that we have
correct constants set by comparing that against the definitions the compiler
provides. This can trip on some platforms, of course.
Lastly, I am not sure whether I covered all possible long double types that
could occur in NuttX. One notable omission I know about is IBM float, but as
far as I can see, it wasn't covered for double either.
## Testing
I tried to compile these changes on `sim:nsh`, `same70-xplained:nsh`, and
`rv-virt:nsh` with gcc. No warnings or errors were introduced and in case of
same70 the referenced warnigs are gone.
--
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]