Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
AST静态代码扫描
mem.c 静态代码pclint检查报错
发布于 2020-10-16 14:43:58 浏览:1393
订阅该版
``` --- Module: D:\pclint\mem.c (C) D:\pclint\mem.c 149 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 nmem = (struct heap_mem *)&heap_ptr[mem->next]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 162 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 ((struct heap_mem *)&heap_ptr[nmem->next])->prev = (uint8_t *)mem - heap_ptr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 166 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 pmem = (struct heap_mem *)&heap_ptr[mem->prev]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 175 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 ((struct heap_mem *)&heap_ptr[mem->next])->prev = (uint8_t *)pmem - heap_ptr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 217 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem = (struct heap_mem *)heap_ptr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 227 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 heap_end = (struct heap_mem *)&heap_ptr[mem->next]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 239 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 lfree = (struct heap_mem *)heap_ptr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 300 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 ptr = ((struct heap_mem *)&heap_ptr[ptr])->next) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 302 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem = (struct heap_mem *)&heap_ptr[ptr]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 325 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem2 = (struct heap_mem *)&heap_ptr[ptr2]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 340 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 ((struct heap_mem *)&heap_ptr[mem2->next])->prev = ptr2; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 377 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 lfree = (struct heap_mem *)&heap_ptr[lfree->next]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 453 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem = (struct heap_mem *)((uint8_t *)rmem - SIZEOF_STRUCT_MEM); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 473 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem2 = (struct heap_mem *)&heap_ptr[ptr2]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 484 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 ((struct heap_mem *)&heap_ptr[mem2->next])->prev = ptr2; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 570 warning 2445: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct heap_mem *' increases required alignment from 1 to 4 mem = (struct heap_mem *)((uint8_t *)rmem - SIZEOF_STRUCT_MEM); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ D:\pclint\mem.c 213 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("mem init, heap begin address 0x%x, size %d\n", ^ D:\pclint\mem.c 213 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("mem init, heap begin address 0x%x, size %d\n", ^ D:\pclint\mem.c 214 warning 505: redundant left argument to comma (rt_ubase_t)heap_ptr, mem_size_aligned)); ^ D:\pclint\mem.c 213 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("mem init, heap begin address 0x%x, size %d\n", ^ D:\pclint\mem.c 247 warning 525: unexpected negative indentation return -1; ^ D:\pclint\mem.c 246 supplemental 891: statement is controlled by preceding control structure if(mempool_ptr == NULL) ^ D:\pclint\mem.c 276 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d, but align to %d\n", ^ D:\pclint\mem.c 276 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d, but align to %d\n", ^ D:\pclint\mem.c 277 warning 505: redundant left argument to comma size, RT_ALIGN(size, RT_ALIGN_SIZE))); ^ D:\pclint\mem.c 276 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d, but align to %d\n", ^ D:\pclint\mem.c 279 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d\n", size)); ^ D:\pclint\mem.c 279 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d\n", size)); ^ D:\pclint\mem.c 279 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d\n", size)); ^ D:\pclint\mem.c 286 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("no memory\n")); ^ D:\pclint\mem.c 286 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("no memory\n")); ^ D:\pclint\mem.c 388 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ^ D:\pclint\mem.c 388 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ^ D:\pclint\mem.c 390 warning 505: redundant left argument to comma (rt_ubase_t)((uint8_t *)mem + SIZEOF_STRUCT_MEM), ^ D:\pclint\mem.c 389 warning 505: redundant left argument to comma ("allocate memory at 0x%x, size: %d\n", ^ D:\pclint\mem.c 428 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("realloc: out of memory\n")); ^ D:\pclint\mem.c 428 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("realloc: out of memory\n")); ^ D:\pclint\mem.c 564 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ("illegal memory\n")); ^ D:\pclint\mem.c 564 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ("illegal memory\n")); ^ D:\pclint\mem.c 572 warning 523: expression statement involving operator ',' lacks side effects RT_DEBUG_LOG(RT_DEBUG_MEM, ^ D:\pclint\mem.c 572 warning 505: redundant left argument to comma RT_DEBUG_LOG(RT_DEBUG_MEM, ^ D:\pclint\mem.c 574 warning 505: redundant left argument to comma (rt_ubase_t)rmem, ^ D:\pclint\mem.c 573 warning 505: redundant left argument to comma ("release memory 0x%x, size: %d\n", ^ --- Module Wrap-up --- Global Wrap-up --- Module: D:\pclint\mem.c (C) ```
查看更多
4
个回答
默认排序
按发布时间排序
ljt8015
2020-10-16
这家伙很懒,什么也没写!
这些warning怎么清除?
xsx669
2024-07-20
这家伙很懒,什么也没写!
rt thread studio软件中怎么设置添加pc lint工具?
杰瑞鼠
2024-11-04
2024龙行天下
同问,你得pc_lint是配合rt_thread studio用的吗?可以将使用过程分享一下
寻找GUI
2024-11-04
没有最终的成功,也没有致命的失败,可贵的是继续前进的勇气
期待分享使用过程
撰写答案
登录
注册新账号
关注者
0
被浏览
1.4k
关于作者
ljt8015
这家伙很懒,什么也没写!
提问
32
回答
141
被采纳
0
关注TA
发私信
相关问题
1
rt thread studio软件中怎么设置添加pc lint工具
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
at_device
ulog
C++_cpp
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
张世争
8
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
KunYi
6
个答案
1
次被采纳
本月文章贡献
程序员阿伟
6
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部