-
Notifications
You must be signed in to change notification settings - Fork 680
debug-engine: fix a few type mismatches #4189
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
debug-engine: fix a few type mismatches #4189
Conversation
0b1af51
to
72fc24d
Compare
How about |
uint32 is an alias of uint32_t. the code this PR fixes is using uint32/int32. theoretically, it's possible to make uint32 and uint32_t different. but i guess it causes far more issues than fixes. |
So, should we use Plus, I noticed some |
why do you think so?
are you suggesting it's a problem? how? |
I suspect the issue arose when I saw the changes in core/iwasm/libraries/debug-engine/gdbserver.*. It appears to be an incomplete modification. Please help to me to understand the situation.
$ egrep -rnc "uint32|int32" core/iwasm/libraries/debug-engine
core/iwasm/libraries/debug-engine/packets.c:1
core/iwasm/libraries/debug-engine/debug_engine.cmake:0
core/iwasm/libraries/debug-engine/utils.c:3
core/iwasm/libraries/debug-engine/handler.c:20
core/iwasm/libraries/debug-engine/handler.h:1
core/iwasm/libraries/debug-engine/gdbserver.c:4
core/iwasm/libraries/debug-engine/debug_engine.h:15
core/iwasm/libraries/debug-engine/debug_engine.c:48
core/iwasm/libraries/debug-engine/gdbserver.h:2
core/iwasm/libraries/debug-engine/utils.h:5
core/iwasm/libraries/debug-engine/packets.h:0 |
we should not assume for example, |
Totally agree. If treating "int32 like a long" is the problem, then by the same reasoning, "uint32" could also be problematic. Right? |
yes. |
Then, two problems:
|
i don't see any reasons to replace them all. |
Certainly. Just out of curiosity, if the next contributor intends to add a new function in core/iwasm/libraries/debug-engine/gdbserver.h, should they use |
nothing specific to debug-engine. |
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.
LGTM
Note: on some targets, int32_t is a long. for example, GCC shipped with the recent ESP-IDF has such a configuration. [1] [1] apache/nuttx#15755 (comment) cf. apache/nuttx#16022 https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes
complained by GCC -Wstrict-prototypes
72fc24d
to
151e123
Compare
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.
LGTM
@no1wudi could you merge this patch to unblock ci on nuttx side? |
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.
LGTM
- use strict prototypes complained by GCC `-Wstrict-prototypes` - use `int*` instead of `int32*` Note: on some targets, int32_t is a long. for example, GCC shipped with the recent ESP-IDF has such a configuration. - apache/nuttx#15755 (comment) - apache/nuttx#16022 - https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes
debug-engine: fix a few type mismatches
Note: on some targets, int32_t is a long.
for example, GCC shipped with the recent ESP-IDF has such a
configuration. [1]
[1] apache/nuttx#15755 (comment)
cf.
apache/nuttx#16022
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes
also, use strict prototypes as it's complained by the same version of GCC.