解决tensorflow问题:AttributeError: _parse_flags

本文介绍了解决使用TensorFlow时遇到的FLAGS._parse_flags()方法被弃用的问题。此方法在TensorFlow升级后不再推荐使用,替代方案为FLAGS.flag_values_dict()。文章提供了解决步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Traceback (most recent call last):
  File "eval.py", line 27, in <module>
    FLAGS._parse_flags()
  File "D:\anconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\flags.py", line 85, in __getattr__
    return wrapped.__getattr__(name)
  File "D:\anconda\envs\tensorflow\lib\site-packages\absl\flags\_flagvalues.py", line 470, in __getattr__
    raise AttributeError(name)
AttributeError: _parse_flags

很多tensorflow的新朋友用别人的项目时都会遇到这种问题,废话不多说。

这是由于tensorflow升级后FLAGS._parse_flags()这种方法被弃用了,改成了用FLAGS.flag_values_dict()这种方法,

只需把这个方法替换就行。

在进行busybox1.36.1编译的时候报如下错误: networking/tc.c: In function ‘cbq_print_opt’: networking/tc.c:236:27: error: ‘TCA_CBQ_MAX’ undeclared (first use in this function); did you mean ‘TCA_CBS_MAX’? 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~~~~~~~~~~ | TCA_CBS_MAX networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in networking/tc.c:249:16: error: ‘TCA_CBQ_RATE’ undeclared (first use in this function); did you mean ‘TCA_TBF_RATE64’? 249 | if (tb[TCA_CBQ_RATE]) { | ^~~~~~~~~~~~ | TCA_TBF_RATE64 AS libbb/hash_md5_sha256_x86-32_shaNI.o CC coreutils/sleep.o AR util-linux/volume_id/lib.a networking/tc.c:255:16: error: ‘TCA_CBQ_LSSOPT’ undeclared (first use in this function) 255 | if (tb[TCA_CBQ_LSSOPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:256:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_lssopt’ 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss)) | ^ networking/tc.c:261:16: error: ‘TCA_CBQ_WRROPT’ undeclared (first use in this function) 261 | if (tb[TCA_CBQ_WRROPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:262:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_wrropt’ 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr)) | ^ CC miscutils/microcom.o networking/tc.c:267:16: error: ‘TCA_CBQ_FOPT’ undeclared (first use in this function) 267 | if (tb[TCA_CBQ_FOPT]) { | ^~~~~~~~~~~~ networking/tc.c:268:59: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_fopt’ 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt)) | ^ CC miscutils/mt.o AS libbb/hash_md5_sha256_x86-64_shaNI.o CC miscutils/nandwrite.o networking/tc.c:273:16: error: ‘TCA_CBQ_OVL_STRATEGY’ undeclared (first use in this function) 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:274:67: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl)) | ^ networking/tc.c:277:50: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 277 | (unsigned) sizeof(*ovl)); | ^ AS libbb/hash_md5_sha_x86-32_shaNI.o networking/tc.c:293:23: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 293 | if (lss && lss->flags) { | ^~ networking/tc.c:296:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~ networking/tc.c:296:32: error: ‘TCF_CBQ_LSS_BOUNDED’ undeclared (first use in this function) 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~~~~~~~~~~~~~~~~~~ networking/tc.c:300:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~ coreutils/shred.c: In function ‘shred_main’: coreutils/shred.c:104:25: warning: ignoring return value of ‘ftruncate’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 104 | ftruncate(fd, 0); | ^~~~~~~~~~~~~~~~ CC coreutils/sort.o CC miscutils/partprobe.o AS libbb/hash_md5_sha_x86-64.o networking/tc.c:300:32: error: ‘TCF_CBQ_LSS_ISOLATED’ undeclared (first use in this function) 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:308:24: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~ networking/tc.c:308:38: error: ‘TC_CBQ_MAXPRIO’ undeclared (first use in this function) 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~~~~~~~~~~~~~ networking/tc.c:309:46: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 309 | printf("prio %u", wrr->priority); | ^~ networking/tc.c:313:43: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 313 | printf("/%u ", wrr->cpriority); | ^~ networking/tc.c:314:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 314 | if (wrr->weight != 1) { | ^~ networking/tc.c:315:65: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 315 | print_rate(buf, sizeof(buf), wrr->weight); | ^~ networking/tc.c:318:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 318 | if (wrr->allot) | ^~ networking/tc.c:319:57: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 319 | printf("allot %ub ", wrr->allot); | ^~ networking/tc.c:236:24: warning: unused variable ‘tb’ [-Wunused-variable] 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~ make[1]: *** [scripts/Makefile.build:197:networking/tc.o] 错误 1 make: *** [Makefile:744:networking] 错误 2 make: *** 正在等待未完成的任务....
最新发布
06-13
loginutils/getty.c: In function ‘open_tty’: loginutils/getty.c:224:17: warning: ignoring return value of ‘fchown’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 224 | fchown(0, 0, 0); /* 0:0 */ | ^~~~~~~~~~~~~~~ CC loginutils/login.o loginutils/login.c: In function ‘login_main’: loginutils/login.c:558:9: warning: ignoring return value of ‘fchown’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 558 | fchown(0, pw->pw_uid, pw->pw_gid); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC loginutils/passwd.o CC loginutils/su.o CC loginutils/sulogin.o loginutils/sulogin.c: In function ‘sulogin_main’: loginutils/sulogin.c:55:17: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 55 | dup(xopen(argv[0], O_RDWR)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ loginutils/sulogin.c:57:17: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 57 | dup(0); | ^~~~~~ CC loginutils/vlock.o AR loginutils/lib.a LD mailutils/built-in.o CC mailutils/mail.o CC mailutils/makemime.o mailutils/makemime.c: In function ‘makemime_main’: mailutils/makemime.c:204:17: warning: ignoring return value of ‘freopen’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 204 | freopen(opt_output, "w", stdout); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC mailutils/popmaildir.o CC mailutils/reformime.o CC mailutils/sendmail.o AR mailutils/lib.a LD miscutils/built-in.o CC miscutils/adjtimex.o CC miscutils/ascii.o CC miscutils/bc.o CC miscutils/beep.o CC miscutils/chat.o CC miscutils/conspy.o CC miscutils/crond.o CC miscutils/crontab.o miscutils/crontab.c: In function ‘crontab_main’: miscutils/crontab.c:161:17: warning: ignoring return value of ‘fchown’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 161 | fchown(src_fd, pas->pw_uid, pas->pw_gid); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC miscutils/devmem.o CC miscutils/fbsplash.o CC miscutils/hdparm.o CC miscutils/hexedit.o CC miscutils/i2c_tools.o miscutils/i2c_tools.c: In function ‘list_i2c_busses_and_exit’: miscutils/i2c_tools.c:1152:46: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=] 1152 | snprintf(path, NAME_MAX, "%s/%s/name", | ^~ In file included from /usr/arm-linux-gnueabi/include/stdio.h:980, from include/libbb.h:31, from miscutils/i2c_tools.c:66: In function ‘snprintf’, inlined from ‘list_i2c_busses_and_exit’ at miscutils/i2c_tools.c:1152:3: /usr/arm-linux-gnueabi/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 25 and 280 bytes into a destination of size 255 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ miscutils/i2c_tools.c: In function ‘list_i2c_busses_and_exit’: miscutils/i2c_tools.c:1157:38: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=] 1157 | "%s/%s/device/name", | ^~ In function ‘snprintf’, inlined from ‘list_i2c_busses_and_exit’ at miscutils/i2c_tools.c:1156:4: /usr/arm-linux-gnueabi/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 32 and 287 bytes into a destination of size 255 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ miscutils/i2c_tools.c: In function ‘list_i2c_busses_and_exit’: miscutils/i2c_tools.c:1165:38: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=] 1165 | "%s/%s/device/name", | ^~ In function ‘snprintf’, inlined from ‘list_i2c_busses_and_exit’ at miscutils/i2c_tools.c:1164:4: /usr/arm-linux-gnueabi/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 32 and 287 bytes into a destination of size 255 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ miscutils/i2c_tools.c: In function ‘list_i2c_busses_and_exit’: miscutils/i2c_tools.c:1177:54: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 236 [-Wformat-truncation=] 1177 | "%s/%s/device/%s/name", | ^~ In function ‘snprintf’, inlined from ‘list_i2c_busses_and_exit’ at miscutils/i2c_tools.c:1176:6: /usr/arm-linux-gnueabi/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 33 and 543 bytes into a destination of size 255 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ CC miscutils/less.o CC miscutils/lsscsi.o CC miscutils/makedevs.o CC miscutils/man.o miscutils/man.c: In function ‘run_pipe’: miscutils/man.c:160:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 160 | system(cmd); | ^~~~~~~~~~~ CC miscutils/microcom.o miscutils/microcom.c: In function ‘microcom_main’: miscutils/microcom.c:160:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 160 | write(sfd, &c, 1); | ^~~~~~~~~~~~~~~~~ CC miscutils/mt.o CC miscutils/nandwrite.o CC miscutils/partprobe.o CC miscutils/raidautorun.o CC miscutils/readahead.o CC miscutils/runlevel.o CC miscutils/rx.o CC miscutils/seedrng.o CC miscutils/setfattr.o CC miscutils/setserial.o CC miscutils/strings.o CC miscutils/time.o CC miscutils/tree.o CC miscutils/ts.o CC miscutils/ttysize.o CC miscutils/ubi_tools.o CC miscutils/ubirename.o CC miscutils/volname.o CC miscutils/watchdog.o miscutils/watchdog.c: In function ‘watchdog_main’: miscutils/watchdog.c:161:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 161 | write(3, "", 1); /* write zero byte */ | ^~~~~~~~~~~~~~~ miscutils/watchdog.c: In function ‘shutdown_watchdog’: miscutils/watchdog.c:71:9: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 71 | write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ | ^~~~~~~~~~~~~~~ AR miscutils/lib.a LD modutils/built-in.o CC modutils/modinfo.o CC modutils/modprobe-small.o CC modutils/modutils.o modutils/modutils.c: In function ‘filename2modname’: modutils/modutils.c:115:1: warning: function may return address of local variable [-Wreturn-local-addr] 115 | } | ^ modutils/modutils.c:94:14: note: declared here 94 | char local_modname[MODULE_NAME_LEN]; | ^~~~~~~~~~~~~ AR modutils/lib.a LD networking/built-in.o CC networking/arp.o In file included from networking/arp.c:43: networking/arp.c: In function ‘arp_show’: include/libbb.h:236:28: warning: ignoring return value of ‘fgets_unlocked’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 236 | # define fgets(s,n,stream) fgets_unlocked(s,n,stream) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ networking/arp.c:430:9: note: in expansion of macro ‘fgets’ 430 | fgets(line, sizeof(line), fp); | ^~~~~ CC networking/arping.o CC networking/brctl.o CC networking/dnsd.o CC networking/ether-wake.o CC networking/ftpd.o networking/ftpd.c: In function ‘popen_ls’: networking/ftpd.c:718:17: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 718 | dup(STDOUT_FILENO); /* copy will become STDIN_FILENO */ | ^~~~~~~~~~~~~~~~~~ CC networking/ftpgetput.o CC networking/hostname.o CC networking/httpd.o CC networking/ifconfig.o CC networking/ifenslave.o CC networking/ifplugd.o CC networking/ifupdown.o CC networking/inetd.o CC networking/interface.o In file included from networking/interface.c:33: networking/interface.c: In function ‘if_readlist_proc’: include/libbb.h:236:28: warning: ignoring return value of ‘fgets_unlocked’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 236 | # define fgets(s,n,stream) fgets_unlocked(s,n,stream) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ networking/interface.c:554:9: note: in expansion of macro ‘fgets’ 554 | fgets(buf, sizeof buf, fh); /* eat line */ | ^~~~~ include/libbb.h:236:28: warning: ignoring return value of ‘fgets_unlocked’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 236 | # define fgets(s,n,stream) fgets_unlocked(s,n,stream) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ networking/interface.c:555:9: note: in expansion of macro ‘fgets’ 555 | fgets(buf, sizeof buf, fh); | ^~~~~ CC networking/ip.o CC networking/ipcalc.o CC networking/isrv.o CC networking/isrv_identd.o CC networking/nameif.o CC networking/nbd-client.o networking/nbd-client.c: In function ‘nbdclient_main’: networking/nbd-client.c:281:25: warning: ignoring return value of ‘daemon’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 281 | daemon(0, 0); | ^~~~~~~~~~~~ CC networking/nc.o CC networking/netstat.o CC networking/nslookup.o networking/nslookup.c: In function ‘send_queries’: networking/nslookup.c:622:33: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 622 | write(pfd.fd, G.query[qn].query, G.query[qn].qlen); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC networking/ntpd.o networking/ntpd.c: In function ‘update_local_clock’: networking/ntpd.c:1624:49: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘long long int’ [-Wformat=] 1624 | bb_error_msg("p adjtimex freq:%ld offset:%+ld status:0x%x tc:%ld", | ~~^ | | | long int | %lld 1625 | tmx.freq, tmx.offset, tmx.status, tmx.constant); | ~~~~~~~~ | | | long long int networking/ntpd.c:1624:61: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘long long int’ [-Wformat=] 1624 | bb_error_msg("p adjtimex freq:%ld offset:%+ld status:0x%x tc:%ld", | ~~~^ | | | long int | %+lld 1625 | tmx.freq, tmx.offset, tmx.status, tmx.constant); | ~~~~~~~~~~ | | | long long int networking/ntpd.c:1624:80: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘long long int’ [-Wformat=] 1624 | bb_error_msg("p adjtimex freq:%ld offset:%+ld status:0x%x tc:%ld", | ~~^ | | | long int | %lld 1625 | tmx.freq, tmx.offset, tmx.status, tmx.constant); | ~~~~~~~~~~~~ | | | long long int networking/ntpd.c:1739:48: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘long long int’ [-Wformat=] 1739 | VERB4 bb_error_msg("adjtimex:%d freq:%ld offset:%+ld status:0x%x", | ~~^ | | | long int | %lld 1740 | rc, tmx.freq, tmx.offset, tmx.status); | ~~~~~~~~ | | | long long int networking/ntpd.c:1739:60: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘long long int’ [-Wformat=] 1739 | VERB4 bb_error_msg("adjtimex:%d freq:%ld offset:%+ld status:0x%x", | ~~~^ | | | long int | %+lld 1740 | rc, tmx.freq, tmx.offset, tmx.status); | ~~~~~~~~~~ | | | long long int CC networking/parse_pasv_epsv.o CC networking/ping.o CC networking/pscan.o CC networking/route.o CC networking/slattach.o networking/slattach.c: In function ‘slattach_main’: networking/slattach.c:225:17: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 225 | system(extcmd); | ^~~~~~~~~~~~~~ CC networking/ssl_client.o CC networking/tc.o networking/tc.c: In function ‘cbq_print_opt’: networking/tc.c:236:27: error: ‘TCA_CBQ_MAX’ undeclared (first use in this function); did you mean ‘TCA_CBS_MAX’? 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~~~~~~~~~~ | TCA_CBS_MAX networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in networking/tc.c:249:16: error: ‘TCA_CBQ_RATE’ undeclared (first use in this function); did you mean ‘TCA_TBF_RATE64’? 249 | if (tb[TCA_CBQ_RATE]) { | ^~~~~~~~~~~~ | TCA_TBF_RATE64 networking/tc.c:255:16: error: ‘TCA_CBQ_LSSOPT’ undeclared (first use in this function) 255 | if (tb[TCA_CBQ_LSSOPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:256:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_lssopt’ 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss)) | ^ networking/tc.c:261:16: error: ‘TCA_CBQ_WRROPT’ undeclared (first use in this function) 261 | if (tb[TCA_CBQ_WRROPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:262:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_wrropt’ 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr)) | ^ networking/tc.c:267:16: error: ‘TCA_CBQ_FOPT’ undeclared (first use in this function) 267 | if (tb[TCA_CBQ_FOPT]) { | ^~~~~~~~~~~~ networking/tc.c:268:59: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_fopt’ 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt)) | ^ networking/tc.c:273:16: error: ‘TCA_CBQ_OVL_STRATEGY’ undeclared (first use in this function) 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:274:67: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl)) | ^ networking/tc.c:277:50: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 277 | (unsigned) sizeof(*ovl)); | ^ networking/tc.c:293:23: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 293 | if (lss && lss->flags) { | ^~ networking/tc.c:296:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~ networking/tc.c:296:32: error: ‘TCF_CBQ_LSS_BOUNDED’ undeclared (first use in this function) 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~~~~~~~~~~~~~~~~~~ networking/tc.c:300:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~ networking/tc.c:300:32: error: ‘TCF_CBQ_LSS_ISOLATED’ undeclared (first use in this function) 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:308:24: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~ networking/tc.c:308:38: error: ‘TC_CBQ_MAXPRIO’ undeclared (first use in this function) 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~~~~~~~~~~~~~ networking/tc.c:309:46: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 309 | printf("prio %u", wrr->priority); | ^~ networking/tc.c:313:43: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 313 | printf("/%u ", wrr->cpriority); | ^~ networking/tc.c:314:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 314 | if (wrr->weight != 1) { | ^~ networking/tc.c:315:65: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 315 | print_rate(buf, sizeof(buf), wrr->weight); | ^~ networking/tc.c:318:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 318 | if (wrr->allot) | ^~ networking/tc.c:319:57: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 319 | printf("allot %ub ", wrr->allot); | ^~ networking/tc.c:236:24: warning: unused variable ‘tb’ [-Wunused-variable] 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~ make[1]: *** [scripts/Makefile.build:198:networking/tc.o] 错误 1 make: *** [Makefile:744:networking] 错误 2 CC networking/tc.o networking/tc.c: In function ‘cbq_print_opt’: networking/tc.c:236:27: error: ‘TCA_CBQ_MAX’ undeclared (first use in this function); did you mean ‘TCA_CBS_MAX’? 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~~~~~~~~~~ | TCA_CBS_MAX networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in networking/tc.c:249:16: error: ‘TCA_CBQ_RATE’ undeclared (first use in this function); did you mean ‘TCA_TBF_RATE64’? 249 | if (tb[TCA_CBQ_RATE]) { | ^~~~~~~~~~~~ | TCA_TBF_RATE64 networking/tc.c:255:16: error: ‘TCA_CBQ_LSSOPT’ undeclared (first use in this function) 255 | if (tb[TCA_CBQ_LSSOPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:256:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_lssopt’ 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss)) | ^ networking/tc.c:261:16: error: ‘TCA_CBQ_WRROPT’ undeclared (first use in this function) 261 | if (tb[TCA_CBQ_WRROPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:262:61: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_wrropt’ 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr)) | ^ networking/tc.c:267:16: error: ‘TCA_CBQ_FOPT’ undeclared (first use in this function) 267 | if (tb[TCA_CBQ_FOPT]) { | ^~~~~~~~~~~~ networking/tc.c:268:59: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_fopt’ 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt)) | ^ networking/tc.c:273:16: error: ‘TCA_CBQ_OVL_STRATEGY’ undeclared (first use in this function) 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:274:67: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl)) | ^ networking/tc.c:277:50: error: invalid application of ‘sizeof’ to incomplete type ‘struct tc_cbq_ovl’ 277 | (unsigned) sizeof(*ovl)); | ^ networking/tc.c:293:23: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 293 | if (lss && lss->flags) { | ^~ networking/tc.c:296:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~ networking/tc.c:296:32: error: ‘TCF_CBQ_LSS_BOUNDED’ undeclared (first use in this function) 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~~~~~~~~~~~~~~~~~~ networking/tc.c:300:24: error: invalid use of undefined type ‘struct tc_cbq_lssopt’ 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~ networking/tc.c:300:32: error: ‘TCF_CBQ_LSS_ISOLATED’ undeclared (first use in this function) 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:308:24: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~ networking/tc.c:308:38: error: ‘TC_CBQ_MAXPRIO’ undeclared (first use in this function) 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~~~~~~~~~~~~~ networking/tc.c:309:46: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 309 | printf("prio %u", wrr->priority); | ^~ networking/tc.c:313:43: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 313 | printf("/%u ", wrr->cpriority); | ^~ networking/tc.c:314:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 314 | if (wrr->weight != 1) { | ^~ networking/tc.c:315:65: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 315 | print_rate(buf, sizeof(buf), wrr->weight); | ^~ networking/tc.c:318:32: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 318 | if (wrr->allot) | ^~ networking/tc.c:319:57: error: invalid use of undefined type ‘struct tc_cbq_wrropt’ 319 | printf("allot %ub ", wrr->allot); | ^~ networking/tc.c:236:24: warning: unused variable ‘tb’ [-Wunused-variable] 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~ make[1]: *** [scripts/Makefile.build:198:networking/tc.o] 错误 1 make: *** [Makefile:744:networking] 错误 2
06-12
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值