分类: LINUX
2018-08-14 12:17:40
编译类openwrt sdk时,出现个gdate.c的错误,与编译器版本有关,打个patch就好
问题:
gdate.c: In function 'g_date_strftime':
gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]
tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
^~~~~~
cc1: some warnings being treated as errors
make[10]: *** [Makefile:1386: libglib_2_0_la-gdate.lo] Error 1
make[10]: Leaving directory '/opt/water/tina-sdk/out/mandolin-perf1/compile_dir/host/pkg-config-0.29/glib/glib'
解决:
单独改源码方式不好,下次重新编译有可能又要重新改, 所以新建个patch一劳永逸
tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch
内容如下:
点击(此处)折叠或打开