Skip to content

消除usb结构体gcc编译时的相关警告 #1744

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

Merged
merged 2 commits into from
Sep 3, 2018
Merged

消除usb结构体gcc编译时的相关警告 #1744

merged 2 commits into from
Sep 3, 2018

Conversation

liruncong
Copy link
Contributor

消除usb结构体gcc编译时的相关警告,这些警告在更严格的armclang编译器中可能是错.为减少移植的手动更改数量,消除这些警告.
1)消除usb结构体定义警告.改为规范的结构体定义,消除警告
2)消除函数_interface_handler中,变量设置但未使用的警告.删除这些变量,消除警告
3)消除_cbw_verify函数中连续多次使用&&和||的警告,&&优先级高于||,加括号消除警告
4)删除未用函数rt_usbd_ep_unassign,消除函数未用警告

@BernardXiong BernardXiong requested a review from lymzzyh August 28, 2018 00:43
@@ -1865,19 +1864,6 @@ static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep)
return -RT_ERROR;
}

static rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个要预留下来,是有可能用到的 当有多个config的时候在切换config的时候是会用到的,不过目前还没有完善这个功能

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那么先把static属性移除?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也可以

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照BernardXiong的方法先把static属性去掉了

2. 修改一处存在多余括号问题. armclang有警告发出.
@BernardXiong BernardXiong merged commit 10de75f into RT-Thread:master Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants