Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
AST静态代码扫描
mem.c 静态代码pclint检查报错
发布于 2020-10-16 14:43:58 浏览:1497
订阅该版
``` --- 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
2025再接再励
同问,你得pc_lint是配合rt_thread studio用的吗?可以将使用过程分享一下
寻找GUI
2024-11-04
没有最终的成功,也没有致命的失败,可贵的是继续前进的勇气
期待分享使用过程
撰写答案
登录
注册新账号
关注者
0
被浏览
1.5k
关于作者
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
【RT-Thread】【ci】【scons】将ci.attachconfig.yml和scons结合使用
2
Rt-thread中OTA下载后,bootloader不搬程序
3
ulog 日志 LOG_HEX 输出时间改为本地日期时间
4
在RT-Thread Studio中构建前执行python命令
5
研究一了一段时间RTT,直接标准版上手太难,想用nano,但又舍不得组件
热门标签
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
I2C_IIC
ESP8266
UART
WIZnet_W5500
ota在线升级
cubemx
PWM
flash
freemodbus
BSP
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
xusiwei1236
8
个答案
2
次被采纳
踩姑娘的小蘑菇
1
个答案
2
次被采纳
用户名由3_15位
9
个答案
1
次被采纳
bernard
4
个答案
1
次被采纳
RTT_逍遥
3
个答案
1
次被采纳
本月文章贡献
聚散无由
2
篇文章
15
次点赞
catcatbing
2
篇文章
5
次点赞
Wade
2
篇文章
4
次点赞
Ghost_Girls
1
篇文章
7
次点赞
xiaorui
1
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部