@memory
make编译会报错,猜测和环境相关(我的ubuntu是20.04)
编译报错1:
gdbusauth.c:1298:11: error: '%s' directive argument is null [-Werror=format-overflow=]
1298 | debug_print ("SERVER: WaitingForBegin, read '%s'", line);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gdbusmessage.c: In function 'g_dbus_message_to_blob':
gdbusmessage.c:2698:30: error: '%s' directive argument is null [-Werror=format-overflow=]
2698 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
|
解决:
在前面手动加上条件判断就好了:if(line != NULL)、if(signature_str!= NULL),或者直接屏蔽该行
编译报错2:
gawk: ./mkerrcodes.awk:88: warning: regexp escape sequence `\#' is not a known regexp operator
rm _mkerrcodes.h
cc -I. -I. -o mkerrcodes ./mkerrcodes.c
./mkerrcodes | gawk -f ./mkerrcodes2.awk >code-from-errno.h
gawk: ./mkerrcodes2.awk:94: warning: regexp escape sequence `\#' is not a known regexp operator
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
./err-sources.h.in >err-sources-sym.h
gawk: ./mkstrtable.awk:113: warning: regexp escape sequence `\#' is not a known regexp operator
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
./err-codes.h.in >err-codes-sym.h
gawk: ./mkstrtable.awk:113: warning: regexp escape sequence `\#' is not a known regexp operator
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
-v prefix=GPG_ERR_ -v namespace=errnos_ \
./errnos.in >errnos-sym.h
gawk: fatal: cannot use gawk builtin `namespace' as variable name
make[6]: *** [Makefile:1324: errnos-sym.h] Error 2
解决:逐一将"sub (/#.+/, “”);",改为:“sub (/#.+/, “”);”,也就是说最新的gawk能够识别到’#'号不需要使用转义字符(‘\‘)的帮助。另外将“namespce”改为“pkg_namespace”:
cd d1-tina-sdk/out/d1-hdmionly/compile_dir/target/libgpg-error-1.27
grep -rn "sub (/\#*" ./
grep -rn "namespace" ./