-
Notifications
You must be signed in to change notification settings - Fork 2.9k
IAR build fixes after 4.1.0 #10635
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
base: development
Are you sure you want to change the base?
IAR build fixes after 4.1.0 #10635
Changes from all commits
a4fc46d
95edb2d
90a56e0
91350be
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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Bugfix | ||
| * Fix some IAR warnings. Fixes #10648. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,15 @@ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| #include <limits.h> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| #if defined(__IAR_SYSTEMS_ICC__) | ||||||||||||||||||||||||||||||||
| /* Suppress a very overeager warning from IAR: it dislikes a forward goto | ||||||||||||||||||||||||||||||||
| * that bypasses the initialization of a variable, even if that variable | ||||||||||||||||||||||||||||||||
| * is not used after the jump. (This is perfectly valid C; it would only | ||||||||||||||||||||||||||||||||
| * be invalid C if jumping into a block from outside that block.) | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| #pragma diag_suppress=Pe546 // transfer of control bypasses initialization | ||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+23
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| #if defined(MBEDTLS_SSL_TLS_C) | ||||||||||||||||||||||||||||||||
| int mbedtls_test_random(void *p_rng, unsigned char *output, size_t output_len) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
|
|
@@ -1358,16 +1367,18 @@ static void mbedtls_test_ssl_cipher_info_from_type(mbedtls_cipher_type_t cipher_ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| int mbedtls_test_ssl_build_transforms(mbedtls_ssl_transform *t_in, | ||||||||||||||||||||||||||||||||
| mbedtls_ssl_transform *t_out, | ||||||||||||||||||||||||||||||||
| int cipher_type, int hash_id, | ||||||||||||||||||||||||||||||||
| int cipher_type_arg, int md_type_arg, | ||||||||||||||||||||||||||||||||
| int etm, int tag_mode, | ||||||||||||||||||||||||||||||||
| mbedtls_ssl_protocol_version tls_version, | ||||||||||||||||||||||||||||||||
| size_t cid0_len, | ||||||||||||||||||||||||||||||||
| size_t cid1_len) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| mbedtls_md_type_t md_type = (mbedtls_md_type_t) md_type_arg; | ||||||||||||||||||||||||||||||||
| mbedtls_cipher_type_t cipher_type = (mbedtls_cipher_type_t) cipher_type_arg; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
Comment on lines
+1370
to
+1378
|
||||||||||||||||||||||||||||||||
| int cipher_type_arg, int md_type_arg, | |
| int etm, int tag_mode, | |
| mbedtls_ssl_protocol_version tls_version, | |
| size_t cid0_len, | |
| size_t cid1_len) | |
| { | |
| mbedtls_md_type_t md_type = (mbedtls_md_type_t) md_type_arg; | |
| mbedtls_cipher_type_t cipher_type = (mbedtls_cipher_type_t) cipher_type_arg; | |
| mbedtls_cipher_type_t cipher_type, | |
| mbedtls_md_type_t md_type, | |
| int etm, int tag_mode, | |
| mbedtls_ssl_protocol_version tls_version, | |
| size_t cid0_len, | |
| size_t cid1_len) | |
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explicit cast looks like it’s compensating for a type mismatch between
ciphersuite->macandmbedtls_md_type_t. Where practical, it’s better to address this at the source (e.g., ensure themacfield is typed asmbedtls_md_type_t, or introduce a clearly named conversion helper) so the codebase doesn’t accumulate casts that can obscure real type issues.