tree-wide: fix compilation with GCC 15.1 and picolibc 1.8.10#21443
tree-wide: fix compilation with GCC 15.1 and picolibc 1.8.10#21443maribu merged 6 commits intoRIOT-OS:masterfrom
Conversation
|
Unfortunately I can't test this locally, but the changes look reasonable. Do you have any test traces of the HM330x? Just to see that the vendored-in function worked the same as the one in the standard library? Edit: Also, you can squash :D |
13d95c3 to
b4a34e5
Compare
Sadly not, I do not have the hardware. But I realized that the reason for me appearing in the copyright is that the function was copied from a test that I did author before this function was moved to |
This replaces the vendored in `print_col_u32_dec()` with the one provided by the `fmt_table` module.
This adds indent to make reading preprocessor conditionals easier, as is recommended by our coding convention.
This adds the `NONSTRING` attribute that is defined as either `__attribute__((nonstring))` or as empty, depending on whether the toolchain understands the `nonstring` attribute. This allows declaring char arrays as not being a zero-terminated c-string without cluttering the code with preprocessor conditinational to ensure backward compatibility with compilers that do not support `-Wunterminated-string-initialization` yet.
This declares all char arrays that intentionally are lacking the terminated zero byte as `NONSTRING`.
b4a34e5 to
9b7a50b
Compare
9b7a50b to
d3bf379
Compare
This adds `-Wno-unterminated-string-initialization` to the `CFLAGS` if (and only if) the compiler supports this. This also adds `-Wno-maybe-uninitialized`. This warning has been supported for quite some time, but the diagnostics triggers more often with newer GCC releases.
This adapts to an API change for providing stdin/stdout/stderr: The macro to test whether globals are to be used is now prefixed with two underscores. Co-authored-by: crasbe <[email protected]>
1470773 to
0be58f6
Compare
| CFLAGS += -Wno-documentation | ||
| endif | ||
|
|
||
| include $(RIOTBASE)/makefiles/utils/strings.mk |
There was a problem hiding this comment.
Interesting: When run with make -j, $(RIOTMAKE) (shorthand for $(RIOTBASE)/makefiles) is not defined for building the tools such as edbg. When build with make it is defined.
These kinds of race conditions really are no fun.
There was a problem hiding this comment.
I didn't look into the CI trace, but often packages are not fully defined and some assume certain variables are set which is not always the case. For example some packages don't build when you're in the folder of the package etc.
pkg/pkg.mk could use some love and the packages as well.
|
Thanks a lot :) |
| NONSTRING | ||
| const uint8_t in1[1] = "a"; | ||
| NONSTRING | ||
| const uint8_t in2[1] = "b"; |
There was a problem hiding this comment.
looks ( first glace) like these should be
in1[1] = 'a';
in2[1] = 'b';There was a problem hiding this comment.
No, that is invalid syntax.
You could do
const uint8_t in1[1] = { 'a' };instead. But that would be the same result as before.
Contribution description
This contains fixes to get RIOT building with a recent toolchain, namely:
__attribute__((nonstring))to char arrays that do not need a terminating zero byte via theNONSTRINGmacro, which is defined to be an empty string for older GCC or clangtests/drivers/hm330xto not use a vendored in implementationTesting procedure
Other than
tests/drivers/hm330x, this should not cause changes in the generated binaries. But compiling with GCC 15.1.0 and with picolibc 1.8.10 should now workIssues/PRs references
None