Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
mem.c 静态代码pclint检查报错
发布于 2020-10-16 14:43:58 浏览:1145
订阅该版
``` --- 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) ```
查看更多
1
个回答
默认排序
按发布时间排序
ljt8015
2020-10-16
这家伙很懒,什么也没写!
这些warning怎么清除?
撰写答案
登录
注册新账号
关注者
0
被浏览
1.1k
关于作者
ljt8015
这家伙很懒,什么也没写!
提问
32
回答
140
被采纳
0
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
机器人操作系统 (ROS2) 和 RT-Thread 通信
4
五分钟玩转RT-Thread新社区
5
国产MCU移植系列教程汇总,欢迎查看!
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
musb移植问题记录【设备注册3次挂起】
2
关于使用CherryUSB时候使用外挂的usb phy 芯片配置的一点注意事项
3
【Vision Board 创客营】Vision Board上的ADC实践
4
FRDM-MCXN947 & RT-Thread的CAN实践——控制GM6020云台电机
5
[Vision Board创客营]WDT实践之配置、issue、PR一条龙
热门标签
RT-Thread Studio
串口
LWIP
Env
SPI
Bootloader
AT
ART-Pi
Hardfault
CAN总线
FinSH
USB
文件系统
RT-Thread
DMA
SCons
线程
RT-Thread Nano
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
ota在线升级
WIZnet_W5500
I2C_IIC
UART
flash
cubemx
packages_软件包
freemodbus
潘多拉开发板_Pandora
PWM
定时器
ADC
BSP
中断
keil_MDK
编译报错
socket
MicroPython
GD32
msh
Debug
ulog
SDIO总线
SFUD
rt_mq_消息队列_msg_queue
C++_cpp
本月问答贡献
xiaorui
7
个答案
3
次被采纳
sakumisu
4
个答案
3
次被采纳
三世执戟
31
个答案
1
次被采纳
梦笑真美
18
个答案
1
次被采纳
踩姑娘的小蘑菇
14
个答案
1
次被采纳
本月文章贡献
Z_Y
2
篇文章
5
次点赞
Alipay
2
篇文章
3
次点赞
2345vor
2
篇文章
1
次点赞
比特饼干
1
篇文章
6
次点赞
Lu_盼盼
1
篇文章
3
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部