Skip to content
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

sys/shell: drop _builtin_cmds define #18075

Merged

Conversation

kaspar030
Copy link
Contributor

Contribution description

Arch just upgraded to arm-none-eabi-gcc 12.1.0, and a new warning popped up:

/home/kaspar/src/riot.rs/sys/shell/shell.c: In function 'find_handler':                                                                            
/home/kaspar/src/riot.rs/sys/shell/shell.c:120:42: error: the comparison will always evaluate as 'true' for the address of '_shell_command_list' wi
ll never be NULL [-Werror=address]                                                                                                                 
  120 |     if (handler == NULL && _builtin_cmds != NULL) {                                                                                        
      |                                          ^~                                                                                                
In file included from /home/kaspar/src/riot.rs/sys/shell/shell.c:41:                                                                               
/home/kaspar/src/riot.rs/sys/include/shell_commands.h:44:30: note: '_shell_command_list' declared here                                             
   44 | extern const shell_command_t _shell_command_list[];                                                                                        
      |                              ^~~~~~~~~~~~~~~~~~~                                                                                           
/home/kaspar/src/riot.rs/sys/shell/shell.c: In function 'print_help':                                                                              
/home/kaspar/src/riot.rs/sys/shell/shell.c:155:23: error: the comparison will always evaluate as 'true' for the address of '_shell_command_list' wi
ll never be NULL [-Werror=address]                                                                                                                 
  155 |     if (_builtin_cmds != NULL) {                                                                                                           
      |                       ^~                                                                                                                   
/home/kaspar/src/riot.rs/sys/include/shell_commands.h:44:30: note: '_shell_command_list' declared here                                             
   44 | extern const shell_command_t _shell_command_list[];                                                                                        
      |                              ^~~~~~~~~~~~~~~~~~~                                                                                           
cc1: all warnings being treated as errors                                                                                                          

The cause was _builtin_cmds being just a define for _shell_command_list[], or, NULL.

That was dependend only on MODULE_SHELL_COMMANDS, so, just use that.

Testing procedure

Issues/PRs references

@github-actions github-actions bot added the Area: sys Area: System label May 9, 2022
@kaspar030 kaspar030 added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 9, 2022
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 9, 2022
@benpicco benpicco merged commit 3771c06 into RIOT-OS:master May 10, 2022
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
@kaspar030 kaspar030 deleted the drop_shell_buildin_commands_define branch November 25, 2022 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants