-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
mbed TLS 1.3: Fix compilation warnings with VS2015 x64 #999
Changes from 3 commits
83081c5
2a0344f
c4b659c
e8c587e
5ad6be7
28d7d3a
e4fd1ba
eb01d3c
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 |
---|---|---|
|
@@ -1267,7 +1267,7 @@ int main( int argc, char *argv[] ) | |
|
||
len = polarssl_snprintf( (char *) buf, sizeof(buf) - 1, GET_REQUEST, | ||
opt.request_page ); | ||
tail_len = strlen( GET_REQUEST_END ); | ||
tail_len = (int) strlen( GET_REQUEST_END ); | ||
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. we should consider changing 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 looked at the code again and I think that if we change this to size_t we will eventually need to use casts back to int. The problem is that functions such as |
||
|
||
/* Add padding to GET request to reach opt.request_size in length */ | ||
if( opt.request_size != DFL_REQUEST_SIZE && | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,8 +57,8 @@ | |
#include <unistd.h> | ||
#else | ||
#include <io.h> | ||
#define read _read | ||
#define write _write | ||
#define read(fd, buf, len) _read( fd, (void *)buf, (unsigned int)len ) | ||
#define write(fd, buf, len) _write( fd, (const void *)buf, (unsigned int)len ) | ||
#endif | ||
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. Could you add brackets around the arguments to ensure the casts also work as intended if compound expressions are passed? 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. Again, I copied this from the development branch: https://github.com/ARMmbed/mbedtls/blob/development/library/net_sockets.c#L66 |
||
|
||
#if defined(_WIN32) || defined(_WIN32_WCE) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1791,7 +1791,7 @@ int main( int argc, char *argv[] ) | |
unsigned char *larger_buf; | ||
|
||
ori_len = ret; | ||
extra_len = ssl_get_bytes_avail( &ssl ); | ||
extra_len = (int) ssl_get_bytes_avail( &ssl ); | ||
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 think it is better to change 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 think that is a good idea, however everything I have done here is backport the fix from the development branch. Do you think I should try to fix the problem here or raise another issue to address this in all the 3 branches? 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 think both:) 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. @RonEld: Even if we change this to size_t we will eventually need to cast as the return type of |
||
|
||
larger_buf = polarssl_malloc( ori_len + extra_len + 1 ); | ||
if( larger_buf == NULL ) | ||
|
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.
There's a typo here.
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.
I copied that from the development branch, so the typo comes from there. I will fix the typo here but I do not think its worth creating a PR for development and mbed TLS 2.1.
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.
Yes, I just saw that. Agreed, we can fix the typo in 2.1 and development on other occasions.