C/C++教程

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

本文主要是介绍gdbusauth.c:1302:11: error: ‘%s’ directive argument is null,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
gdbusauth.c: In function ‘_g_dbus_auth_run_server’:
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 1302 |           debug_print ("SERVER: WaitingForBegin, read '%s'", line);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[6]: *** [Makefile:3633:libgio_2_0_la-gdbusauth.lo] 错误 1
make[6]: *** 正在等待未完成的任务....
gdbusmessage.c: In function ‘parse_value_from_blob’:
gdbusmessage.c:1712:29: warning: variable ‘item’ set but not used [-Wunused-but-set-variable]
 1712 |                   GVariant *item;
      |                             ^~~~
gdbusmessage.c: In function ‘append_value_to_blob’:
gdbusmessage.c:2326:24: warning: unused variable ‘end’ [-Wunused-variable]
 2326 |           const gchar *end;
      |                        ^~~
gdbusmessage.c: In function ‘g_dbus_message_to_blob’:
gdbusmessage.c:2702:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 2702 |       tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[6]: *** [Makefile:3682:libgio_2_0_la-gdbusmessage.lo] 错误 1
make[5]: *** [Makefile:4471:all-recursive] 错误 1

解决方案

1、找到这个文件使用vim打开
2、找到报错的位置,加入如下代码:

if(line != NULL)

if(signature_str!= NULL)

即可完美解决。

这篇关于gdbusauth.c:1302:11: error: ‘%s’ directive argument is null的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!