-
Notifications
You must be signed in to change notification settings - Fork 728
Reduce warnings relevant to Zephyr platform #4658
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: main
Are you sure you want to change the base?
Conversation
e79ae4b to
7639ed9
Compare
|
Update after the initial commit: Apparently, the CI doesn't like that in Zephyr's case I used int instead of os_file_handle. I have tried another way of refactoring the logic of how we abstract the wasm-micro-runtime/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:2216:42: warning: initialization of 'os_file_handle' {aka 'struct zephyr_handle *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
2216 | os_file_handle tfd = fos[i]->file_handle->fd;
| ^~~
wasm-micro-runtime/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:2222:31: warning: initialization of 'int' from 'os_file_handle' {aka 'struct zephyr_handle *'} makes integer from pointer without a cast [-Wint-conversion]
2222 | .fd = tfd,
| ^~~
wasm-micro-runtime/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:2222:31: note: (near initialization for '(anonymous).fd')Fixing temporary workaround which was made in PR#4377 will probably help with these remaining warnings as well. |
7639ed9 to
bdfd724
Compare
|
IMM, a better approach is to avoid using bh_xxx() functions in zephyr/zephyr_file.c. Instead, opt for a specific version that is compatible with Zephyr |
|
Noted, will check out the alternatives. |
|
Removed bh_strdup() function, therefore reducing the undeclared warning. |
| struct zephyr_fs_desc *ptr = &desc_array[i]; | ||
| if (ptr->used && ptr->path && strcmp(ptr->path, abs_old_path) == 0) { | ||
| char *new_path_copy = bh_strdup(new_path); | ||
| size_t new_path_len = strlen(abs_new_path) + 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.
It seems there is another modification to store the absolute path instead of the relative path, which might be better to split into a new PR.
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.
This PR was intended to fix two warning, redefinition of CLOCK_MONOTONIC and implicit declaration of function 'bh_strdup'. With first one parallelly being committed by @TianlongLiang in #4668 , this PR can't be further split anymore.
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.
Or if you mean that I replaced bh_strdup in two places and it would be better to split them in two separate PRs, or I missed something, please let me know.
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.
new_path -> abs_new_path.
The modified version stores absolute paths instead of relative paths in desc_array, which looks good. It would be better to build absolute paths in os_open_preopendir() to ensure all paths are absolute.
If this is intentional, it should be mentioned in the PR description. It's your decision whether to split this into another PR or keep it in the current one. I am okay with both options.
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
986174b to
50d92d3
Compare
This PR is intended to remove following warnings, when build in Zephyr application:
Result - no warnings.Tested in ocre as a zephyr application.
Updates:
there have been updates and changes after the initial commit and initial description. Please check those below in my follow-up comments.