-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
greenhills support: fix the greenhills compile warning on sizeof operand #13502
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extinguish
force-pushed
the
ghs_warning_fix_4
branch
3 times, most recently
from
September 19, 2024 02:45
345ff9d
to
847e173
Compare
[Experimental Bot, please feedback here] NuttX PR Requirements ReviewThis PR appears to partially meet the NuttX requirements. Here's a breakdown: Strengths:
Weaknesses:
Recommendations:
By addressing these points, you will significantly improve the quality of your PR and make it easier for the NuttX maintainers to review and merge your contribution. |
pkarashchenko
approved these changes
Sep 19, 2024
extinguish
force-pushed
the
ghs_warning_fix_4
branch
4 times, most recently
from
September 20, 2024 01:29
80af1ca
to
dc8e49d
Compare
github-actions
bot
added
the
Size: XS
The size of the change in this PR is very small
label
Sep 20, 2024
extinguish
force-pushed
the
ghs_warning_fix_4
branch
3 times, most recently
from
September 20, 2024 07:10
082117c
to
2556d13
Compare
the detailed warning info are: CC: syslog/vsyslog.c "pthread/pthread_create.c", line 443: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression ptcb->cmn.timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); ^ CC: dirent/lib_closedir.c "sched/sched_profil.c", line 81: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg); ^ "sched/sched_profil.c", line 142: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression wd_start(&prof->timer, PROFTICK, profil_timer_handler, (wdparm_t)prof); ^ CC: common/arm_modifyreg8.c "sched/sched_setscheduler.c", line 165: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); ^ CC: misc/lib_utsname.c "sched/sched_unlock.c", line 275: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression rtcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); ^ "sched/sched_roundrobin.c", line 119: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); ^ CC: armv7-m/arm_fpuconfig.c cxarm: Error: No files. Try -help. CC: misc/lib_crc8ccitt.c cxarm: Error: No files. Try -help. cxarm: Error: No files. Try -help. CC: getprime_main.c cxarm: Error: No files. Try -help. cxarm: Error: No files. Try -help. CC: misc/lib_log2ceil.c cxarm: Error: No files. Try -help. CC: task/task_start.c "task/task_setup.c", line 423: warning apache#1931-D: operand of sizeof is not a type, variable, or dereferenced pointer expression tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); ^ Signed-off-by: guoshichao <[email protected]>
extinguish
force-pushed
the
ghs_warning_fix_4
branch
from
September 20, 2024 11:10
2556d13
to
8ecedcc
Compare
xiaoxiang781216
approved these changes
Sep 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
fix the greenhills compile warning on sizeof operand
the following are the detailed warning info:
CC: syslog/vsyslog.c "pthread/pthread_create.c", line 443: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
ptcb->cmn.timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: dirent/lib_closedir.c "sched/sched_profil.c", line 81: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
^
"sched/sched_profil.c", line 142: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, (wdparm_t)prof);
^
CC: common/arm_modifyreg8.c "sched/sched_setscheduler.c", line 165: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: misc/lib_utsname.c "sched/sched_unlock.c", line 275: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
rtcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
"sched/sched_roundrobin.c", line 119: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: armv7-m/arm_fpuconfig.c cxarm: Error: No files. Try -help. CC: misc/lib_crc8ccitt.c cxarm: Error: No files. Try -help. cxarm: Error: No files. Try -help.
CC: getprime_main.c cxarm: Error: No files. Try -help. cxarm: Error: No files. Try -help.
CC: misc/lib_log2ceil.c cxarm: Error: No files. Try -help. CC: task/task_start.c "task/task_setup.c", line 423: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
the reason for the warning
in greenhills compiler, do not allow transfer operand to sizeof() directly in mcaro, we need to transfer the data type of the operand to the sizeof() in macro.
in order to fix this warning, we using typeof() to encapsulate the operand before transfer to the sizeof()
Impact
has no impact on current implementation
Testing
has pass the ostest with gcc and greenhills compiler