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

solution

1. Find the file and use vim to open
it. 2. Find the location of the error and add the following code:

if(line != NULL)

and

if(signature_str!= NULL)

can be solved perfectly.

Guess you like

Origin blog.csdn.net/qq_17623363/article/details/120464921