c++ - GCC 堆栈溢出负数
问题描述
我收到一个非常奇怪的错误消息。负 Flash 溢出。这怎么可能
我正在调用一个调试函数来多次打印出错误消息。此错误记录器功能如下所示
BOOLEAN C_Wrapper_Write_to_File(
const char *const p_ch_Log_File_Name,
const char *const p_ch_log_msg,
const char *const p_ch_File,
const int i_line);
我在这样的多个场合调用这个函数
C_Wrapper_Write_to_File("debug","a veeerrryyy lonnngggg error messssssagge", __FILE__,__LINE__);
结果:这个产生了正16 字节的闪存溢出。
如果我减少字符串长度,我会得到一个负闪溢出
C_Wrapper_Write_to_File("debug","tiny", __FILE__,__LINE__);
../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: ../../bin/3_zellen_2017.elf section `.data' will not fit in region `FLASH'
../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by -24 bytes
现在我很清楚所有 const char[] 数组都存储在闪存中。所以这对我来说非常有意义,当我缩短错误时,Flash 使用量会减少。
问题:
部分
'.data'
将不适合区域'FLASH'
...区域'FLASH'
溢出-24 字节
如何修复有关负数的错误消息?
解决方案
推荐阅读
- php - 如何使用php laravel将二进制图像上传到sql server
- node.js - npm i 期间出错:node-pre-gyp install --fallback-to-build --library=static_library
- amazon-web-services - AWS Glue Crawler 创建分区和文件表
- node.js - 是否可以使用 localStorage 之类的私有环境变量?
- .net - 根据 DataTable 更改 DGV 复选框状态
- r - 替换 for 循环 - R 脚本
- python-3.x - 如何在python中确定outlook项目的类型
- javascript - 从数组中删除重复的对象总是返回第 n 个索引
- grails - 如何使 grails 2 文档退出生成水平滚动条?
- c# - 使用 REST API 将 Xamarin Forms 连接到 SQL Server 2017 Management Studio