MT7688学习笔记 gdate.c:2497:7: error: format not a string literal, format string not checke

此补丁用于解决OpenWRT中使用GLib GDate时出现的字符串格式文字警告问题,通过修改源码确保编译时不再触发此类警告。
https://dev.openwrt.org/browser/trunk/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.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 Makefile:1386: recipe for target 'libglib_2_0_la-gdate.lo' failed make[10]: *** [libglib_2_0_la-gdate.lo] Error 1 make[10]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/glib/glib' Makefile:1933: recipe for target 'all-recursive' failed make[9]: *** [all-recursive] Error 1 make[9]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/glib/glib' Makefile:952: recipe for target 'all' failed make[8]: *** [all] Error 2 make[8]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/glib/glib' Makefile:1045: recipe for target 'all-recursive' failed make[7]: *** [all-recursive] Error 1 make[7]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/glib' Makefile:769: recipe for target 'all' failed make[6]: *** [all] Error 2 make[6]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/glib' Makefile:697: recipe for target 'all-recursive' failed make[5]: *** [all-recursive] Error 1 make[5]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29' Makefile:456: recipe for target 'all' failed make[4]: *** [all] Error 2 make[4]: Leaving directory '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29' Makefile:39: recipe for target '/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/.built' failed make[3]: *** [/home/zhangjc/openwrt-15.05.1/build_dir/host/pkg-config-0.29/.built] Error 2 make[3]: Leaving directory '/home/zhangjc/openwrt-15.05.1/tools/pkg-config' tools/Makefile:122: recipe for target 'tools/pkg-config/compile' failed make[2]: *** [tools/pkg-config/compile] Error 2 make[2]: Leaving directory '/home/zhangjc/openwrt-15.05.1' tools/Makefile:121: recipe for target '/home/zhangjc/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy' failed make[1]: *** [/home/zhangjc/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2 make[1]: Leaving directory '/home/zhangjc/openwrt-15.05.1' /home/zhangjc/openwrt-15.05.1/include/toplevel.mk:182: recipe for target 'world' failed make: *** [world] Error 2
08-08
make[6]: Entering directory '/home/wuyilun/Desktop/NVMP/NVMP/nvmp/build_dir/host/e2fsprogs-1.42.4/lib/quota' CC mkquota.c In file included from mkquota.c:22: mkquota.c: In function 'quota_write_inode': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:133:3: note: in expansion of macro 'log_err' 133 | log_err("Unable to allocate quota handle", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:149:4: note: in expansion of macro 'log_err' 149 | log_err("Cannot initialize io on quotafile", ""); | ^~~~~~~ mkquota.c: In function 'quota_init_context': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:219:3: note: in expansion of macro 'log_err' 219 | log_err("Failed to allocate quota context", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:229:4: note: in expansion of macro 'log_err' 229 | log_err("Failed to allocate dictionary", ""); | ^~~~~~~ mkquota.c: In function 'get_dq': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:274:4: note: in expansion of macro 'log_err' 274 | log_err("Unable to allocate dquot", ""); | ^~~~~~~ mkquota.c: In function 'scan_dquots_callback': common.h:17:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'qsize_t' {aka 'long int'} [-Wformat=] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:421:3: note: in expansion of macro 'log_err' 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ^~~~~~~ mkquota.c:421:46: note: format string is defined here 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ~~~^ | | | long long unsigned int | %lu In file included from mkquota.c:22: common.h:17:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 8 has type 'qsize_t' {aka 'long int'} [-Wformat=] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:421:3: note: in expansion of macro 'log_err' 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ^~~~~~~ mkquota.c:421:52: note: format string is defined here 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ~~~^ | | | long long unsigned int | %lu In file included from mkquota.c:22: common.h:17:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 9 has type 'qsize_t' {aka 'long int'} [-Wformat=] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:421:3: note: in expansion of macro 'log_err' 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ^~~~~~~ mkquota.c:422:9: note: format string is defined here 422 | "(%llu, %llu)", dq->dq_id, dq->dq_dqb.dqb_curspace, | ~~~^ | | | long long unsigned int | %lu In file included from mkquota.c:22: common.h:17:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 10 has type 'qsize_t' {aka 'long int'} [-Wformat=] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:421:3: note: in expansion of macro 'log_err' 421 | log_err("Usage inconsistent for ID %d: (%llu, %llu) != " | ^~~~~~~ mkquota.c:422:15: note: format string is defined here 422 | "(%llu, %llu)", dq->dq_id, dq->dq_dqb.dqb_curspace, | ~~~^ | | | long long unsigned int | %lu In file included from mkquota.c:22: mkquota.c: In function 'quota_update_inode': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:488:3: note: in expansion of macro 'log_err' 488 | log_err("Unable to allocate quota handle", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:494:3: note: in expansion of macro 'log_err' 494 | log_err("Open quota file failed", ""); | ^~~~~~~ mkquota.c: In function 'quota_compare_and_update': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:534:3: note: in expansion of macro 'log_err' 534 | log_err("Open quota file failed", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ mkquota.c:544:3: note: in expansion of macro 'log_err' 544 | log_err("Error scanning dquots", ""); | ^~~~~~~ CC quotaio.c In file included from quotaio.c:21: quotaio.h:19: warning: "MAXQUOTAS" redefined 19 | #define MAXQUOTAS 2 | In file included from /usr/include/x86_64-linux-gnu/sys/quota.h:57, from quotaio.c:18: /usr/include/linux/quota.h:40: note: this is the location of the previous definition 40 | #define MAXQUOTAS 3 | In file included from quotaio.c:20: quotaio.c: In function 'quota_file_open': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:245:3: note: in expansion of macro 'log_err' 245 | log_err("qh_ops->check_file failed", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:251:3: note: in expansion of macro 'log_err' 251 | log_err("qh_ops->init_io failed", ""); | ^~~~~~~ quotaio.c: In function 'quota_inode_init_new': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:266:3: note: in expansion of macro 'log_err' 266 | log_err("ex2fs_read_inode failed", ""); | ^~~~~~~ quotaio.c: In function 'quota_file_create': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:318:3: note: in expansion of macro 'log_err' 318 | log_err("init_new_quota_inode failed", ""); | ^~~~~~~ common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:341:3: note: in expansion of macro 'log_err' 341 | log_err("qh_ops->new_io failed", ""); | ^~~~~~~ quotaio.c: In function 'get_empty_dquot': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio.c:388:3: note: in expansion of macro 'log_err' 388 | log_err("Failed to allocate dquot", ""); | ^~~~~~~ CC quotaio_v2.c In file included from quotaio_v2.c:15: quotaio_v2.c: In function 'v2_check_file': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio_v2.c:163:4: note: in expansion of macro 'log_err' 163 | log_err("Your quota file is stored in wrong " | ^~~~~~~ quotaio_v2.c: In function 'v2_report': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio_v2.c:282:2: note: in expansion of macro 'log_err' 282 | log_err("Not Implemented.", ""); | ^~~~~~~ CC quotaio_tree.c In file included from quotaio_tree.c:15: quotaio_tree.c: In function 'getdqbuf': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio_tree.c:27:3: note: in expansion of macro 'log_err' 27 | log_err("Failed to allocate dqbuf", ""); | ^~~~~~~ quotaio_tree.c: In function 'get_free_dqblk': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio_tree.c:103:4: note: in expansion of macro 'log_err' 103 | log_err("Cannot allocate new quota block " | ^~~~~~~ quotaio_tree.c: In function 'find_free_dqentry': common.h:17:5: warning: too many arguments for format [-Wformat-extra-args] 17 | "[ERROR] %s:%d:%s:: " format "\n", \ | ^~~~~~~~~~~~~~~~~~~~~ quotaio_tree.c:233:3: note: in expansion of macro 'log_err' 233 | log_err("find_free_dqentry(): Data block full but it " | ^~~~~~~ CC ../../e2fsck/dict.c GEN_LIB libquota.a CONFIG.STATUS quota.pc
最新发布
08-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值