-
Notifications
You must be signed in to change notification settings - Fork 2.1k
tree-wide: fix compilation with GCC 15.1 and picolibc 1.8.10 #21443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
85233b3
914429c
0b01fa0
1b70a59
59b1774
0be58f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,6 +197,16 @@ distclean:: clean | |
| endif | ||
|
|
||
| # Disabling some diagnostics: These issues needs to be fixed upstream | ||
| CFLAGS += -Wno-maybe-uninitialized | ||
| ifeq (llvm,$(TOOLCHAIN)) | ||
| CFLAGS += -Wno-documentation | ||
| endif | ||
|
|
||
| include $(RIOTBASE)/makefiles/utils/strings.mk | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting: When run with These kinds of race conditions really are no fun.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
|
||
| # Disabling -Wunterminated-string-initialization on toolchains that support this | ||
| # warning | ||
| ifeq (1,$(call version_is_greater_or_equal,$(GCC_VERSION),15)) | ||
| CFLAGS += -Wno-unterminated-string-initialization | ||
| # this flag should not be passed to g++, only gcc: | ||
| CXXUWFLAGS += -Wno-unterminated-string-initialization | ||
| endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,40 +13,19 @@ | |
| * @file | ||
| * @brief HM330X driver test application | ||
| * | ||
| * @author Marian Buschsieweke <[email protected]> | ||
| * @author Francisco Molina <[email protected]> | ||
| * | ||
| * @} | ||
| */ | ||
|
|
||
| #include <stdio.h> | ||
| #include <string.h> | ||
|
|
||
| #include "fmt.h" | ||
| #include "fmt_table.h" | ||
| #include "time_units.h" | ||
| #include "ztimer.h" | ||
| #include "timex.h" | ||
crasbe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #include "hm330x.h" | ||
| #include "hm330x_params.h" | ||
|
|
||
| static const char spaces[16] = " "; | ||
|
|
||
| static void print_col_u32_dec(uint32_t number, size_t width) | ||
| { | ||
| char sbuf[10]; /* "4294967295" */ | ||
| size_t slen; | ||
|
|
||
| slen = fmt_u32_dec(sbuf, number); | ||
| if (width > slen) { | ||
| width -= slen; | ||
| while (width > sizeof(spaces)) { | ||
| print(spaces, sizeof(spaces)); | ||
| } | ||
| print(spaces, width); | ||
| } | ||
| print(sbuf, slen); | ||
| } | ||
|
|
||
| int main(void) | ||
| { | ||
| hm330x_t dev; | ||
|
|
@@ -61,13 +40,13 @@ | |
| return 1; | ||
| } | ||
|
|
||
|
|
||
| #if IS_USED(MODULE_HM3302) | ||
| print_str( | ||
| "+------------------------+------------------------+----------------------------------------------+\n" | ||
| "| Standard concentration | Atmospheric Environment| # Particles in 0.1l air of diameter >= |\n" | ||
| "| PM1.0 | PM2.5 | PM10.0 | PM1.0 | PM2.5 | PM10.0 | 0.3µm | 0.5µm | 1.0µm | 2.5µm | 5.0µm | 10µm |\n" | ||
| "+-------+-------+--------+-------+-------+--------+-------+-------+-------+-------+-------+------+\n" | ||
| ); | ||
| #else | ||
| print_str( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
|
|
||
| #include <stdio.h> | ||
| #include "embUnit.h" | ||
| #include "compiler_hints.h" | ||
| #include "psa/crypto.h" | ||
|
|
||
| void addFailurePSA(const char *func, psa_status_t errcode, long line, const char *file) | ||
|
|
@@ -31,9 +32,9 @@ | |
| addFailure(msg, line, file); | ||
| } | ||
|
|
||
| #define TEST_ASSERT_PSA(func_, do_) { psa_status_t ret = func_; if (ret != PSA_SUCCESS) { addFailurePSA(#func_, ret, __LINE__, __FILE__); do_; } } | ||
| #define TEST_ASSERT_PSA_CLEANUP(func_) TEST_ASSERT_PSA(func_, goto cleanup) | ||
| #define TEST_ASSERT_PSA_RETURN(func_) TEST_ASSERT_PSA(func_, return) | ||
| #define TEST_ASSERT_PSA_CONTINUE(func_) TEST_ASSERT_PSA(func_, ) | ||
|
|
||
| /* | ||
|
|
@@ -73,7 +74,9 @@ | |
| { | ||
| const psa_algorithm_t alg = PSA_ALG_SHA_256; | ||
|
|
||
| NONSTRING | ||
| const uint8_t in1[1] = "a"; | ||
| NONSTRING | ||
| const uint8_t in2[1] = "b"; | ||
|
Comment on lines
+77
to
80
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks ( first glace) like these should be in1[1] = 'a';
in2[1] = 'b';
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, that is invalid syntax. You could do const uint8_t in1[1] = { 'a' };instead. But that would be the same result as before. |
||
|
|
||
| const uint8_t exp1[] = { | ||
|
|
@@ -181,7 +184,7 @@ | |
| } | ||
|
|
||
| /** | ||
| * Exporting and re-importing a private Ed25519 key should result in the same public key and signature. | ||
| */ | ||
| static void test_exported_key_is_identical_when_imported_again_ed25519(void) | ||
| { | ||
|
|
@@ -219,7 +222,7 @@ | |
| TEST_ASSERT_PSA_CLEANUP(psa_generate_key(&key_attr, &key_id)); | ||
|
|
||
| // sign msg with generated keypair | ||
| TEST_ASSERT_PSA_CLEANUP(psa_sign_message(key_id, key_alg, msg, sizeof(msg), sig, sizeof(sig), &sig_len)); | ||
|
|
||
| // export public and private key, then free slot | ||
| TEST_ASSERT_PSA_CLEANUP(psa_export_public_key(key_id, pubkey, sizeof(pubkey), &pubkey_len)); | ||
|
|
@@ -233,7 +236,7 @@ | |
| TEST_ASSERT(pubkey_len == pubkey2_len && memcmp(pubkey, pubkey2, pubkey_len) == 0); | ||
|
|
||
| // sign msg with imported key and compare signatures | ||
| TEST_ASSERT_PSA_CLEANUP(psa_sign_message(key_id, key_alg, msg, sizeof(msg), sig2, sizeof(sig2), &sig2_len)); | ||
| TEST_ASSERT(sig_len == sig2_len && memcmp(sig, sig2, sig_len) == 0); | ||
|
|
||
| cleanup: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.