gdbusauth.c:1302:11: error: ‘%s’ directive argument is null

本文详细讲述了在Ubuntu系统中使用Buildroot构建根文件系统时遇到的format-overflow错误,通过定位源代码、修改并添加条件来解决问题,适合初学者参考。

对ubuntu系统使用buildroot构建根文件系统

发生错误如下

gdbusauth.c:1302:11: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 1302 |           debug_print ("SERVER: WaitingForBegin, read '%s'", line);
gdbusmessage.c:2702:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 2702 |       tupled_signature_str = g_strdup_printf ("(%s)", signature_str);

通过百度发现是该两文件内缺少了条件

首先寻找到这两个文件

sudo find / -name gdbusauth.c
sudo find / -name gdbusmessage.c

若是寻找不到则make clean  重新继续make all再寻找  直到找到为止

然后进入目录 打开

sudo vi gdbusauth.c

#进入vi编辑器  根据错误找到第1302行  可在一般模式输入1302gg移动到该位置
#在错误前输入    if(line != NULL)
#:wq退出保存

同理

sudo vi gdbusmessage.c

#进入vi编辑器  根据错误找到第2702行  可在一般模式输入2702gg移动到该位置
#在错误前输入    if(signature_str!= NULL)
#:wq退出保存

接着继续make all  然后等到死(bushi  大概两到三小时,所以不建议在宿舍快熄灯的时候运行

finally success!!!!!!

In function 'work_tapo_refresh_log_encrypt_key', inlined from 'work_tapo_log_refresh_nonce' at worker.c:367:2: worker.c:317:2: error: argument 1 null where non-null expected [-Werror=nonnull] 317 | md5_hash(general_password, strlen(general_password), &md5_ctx); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from worker.c:20: worker.c: In function 'work_tapo_log_refresh_nonce': /home/wuyilun/Desktop/SSD920/toolchain/arm-sigmastar-linux-uclibcgnueabihf-9.1.0/arm-sigmastar-linux-uclibcgnueabihf/sysroot/usr/include/string.h:247:15: note: in a call to function 'strlen' declared here 247 | extern size_t strlen (const char *__s) | ^~~~~~ In function 'work_tapo_refresh_log_encrypt_key', inlined from 'work_tapo_log_refresh_nonce' at worker.c:367:2: worker.c:312:2: error: '%s' directive argument is null [-Werror=format-overflow=] 312 | DBG_ERR("tapo_passwd: %s\n", general_password); In function 'work_tapo_refresh_log_encrypt_key', inlined from 'work_tapo_log_refresh_nonce' at worker.c:367:2, inlined from 'worker_file_log_set_handle' at worker.c:4465:4: worker.c:317:2: error: argument 1 null where non-null expected [-Werror=nonnull] 317 | md5_hash(general_password, strlen(general_password), &md5_ctx); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from worker.c:20: worker.c: In function 'worker_file_log_set_handle': /home/wuyilun/Desktop/SSD920/toolchain/arm-sigmastar-linux-uclibcgnueabihf-9.1.0/arm-sigmastar-linux-uclibcgnueabihf/sysroot/usr/include/string.h:247:15: note: in a call to function 'strlen' declared here 247 | extern size_t strlen (const char *__s) | ^~~~~~ In function 'work_tapo_refresh_log_encrypt_key', inlined from 'work_tapo_log_refresh_nonce' at worker.c:367:2, inlined from 'worker_file_log_set_handle' at worker.c:4465:4: worker.c:312:2: error: '%s' directive argument is null [-Werror=format-overflow=] 312 | DBG_ERR("tapo_passwd: %s\n", general_password); cc1: all warnings being treated as errors make[5]: *** [Makefile:82: worker.o] Error 1
11-07
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值