Snippets for acpitool 0.5.1 from Fedora ppc64le
Sourced from https://kojipkgs.fedoraproject.org/packages/acpitool/0.5.1/40.fc45/data/logs/ppc64le/build.log.
-
ac_adapter.cpp:54:27: warning: unused variable ‘str’ [-Wunused-variable] 54 | char filename[4][50], str[40]; | ^~~ -
ac_adapter.cpp:155:23: warning: unused variable ‘start’ [-Wunused-variable] 155 | int ac_count = 0, start = 0, findex = 0; | ^~~~~ -
ac_adapter.cpp:185:27: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 185 | fscanf(temp_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ -
ac_adapter.cpp:221:26: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 221 | fgets(str, 100, power_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
ac_adapter.cpp:178:56: warning: ‘%s’ directive writing up to 255 bytes into a region of size 76 [-Wformat-overflow=] 178 | sprintf(temp, "/sys/class/power_supply/%s/type", name); | ^~ -
ac_adapter.cpp:191:77: warning: ‘%s’ directive writing up to 255 bytes into a region of size 106 [-Wformat-overflow=] 191 | sprintf(filename[findex], "/sys/class/power_supply/%s/uevent", name); | ^~ -
battery.cpp:69:23: warning: variable ‘Use_Sys’ set but not used [-Wunused-but-set-variable=] 69 | int Use_Proc = 0, Use_Sys = 0; | ^~~~~~~ -
freq.cpp:97:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 97 | fscanf(freqinfo_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ -
freq.cpp:121:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 121 | fscanf(freqinfo_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ -
freq.cpp:144:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 144 | fscanf(freqinfo_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ -
ac_adapter.cpp:138:24: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 14 [-Wstringop-truncation] 138 | strncpy(AC_Status, str+25, 8); | ^ -
freq.cpp:166:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 166 | fscanf(freqinfo_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ -
ac_adapter.cpp:110:64: warning: ‘%s’ directive writing up to 255 bytes into a region of size 178 [-Wformat-overflow=] 110 | sprintf(filename[ac_count], "/proc/acpi/ac_adapter/%s/state", name); | ^~ -
freq.cpp:189:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 189 | fscanf(freqinfo_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ -
ac_adapter.cpp:72:64: warning: ‘%s’ directive writing up to 255 bytes into a region of size 178 [-Wformat-overflow=] 72 | sprintf(filename[ac_count], "/proc/acpi/ac_adapter/%s/state", name); | ^~ -
battery.cpp:577:27: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 577 | fscanf(temp_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:56:23: warning: variable ‘bm_activity’ set but not used [-Wunused-but-set-variable=] 56 | long long int bm_activity; | ^~~~~~~~~~~ -
battery.cpp:658:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 658 | fgets(str, 100, power_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
battery.cpp:848:23: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 848 | fscanf(powertype_fp, "%s", str); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:65:45: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 65 | for(int t=0; t<4; t++) fgets(str, 299, cpuinfo_fp); // skip 4 lines // | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:66:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 66 | fgets(str, 299, cpuinfo_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:70:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 70 | fgets(str, 299, cpuinfo_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:71:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 71 | fgets(str, 299, cpuinfo_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:82:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 82 | fgets(str, 299, cpuinfo_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:83:22: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 83 | fgets(str, 299, cpuinfo_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:88:45: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 88 | for(int t=0; t<5; t++) fgets(str, 299, cpuinfo_fp); // we can skip at least 5 lines to reach Bogomips line// | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:92:26: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 92 | fgets(str, 299, cpuinfo_fp); // different for Amd64, Opteron, Core Duo, P4 with Ht, ... // | ~~~~~^~~~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:215:38: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 215 | fgets(str, 100, power_fp); // active state | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:222:38: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 222 | fgets(str, 100, power_fp); // max_cstate | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:231:38: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 231 | fgets(str, 100, power_fp); // bus master activity | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:238:38: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 238 | fgets(str, 100, power_fp); // states (line contains no information) | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:241:46: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 241 | fgets(str, 130, power_fp); // cstate Cx | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:287:42: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 287 | fgets(str, 100, throt_fp); // active state | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
cpu.cpp:291:42: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 291 | fgets(str, 100, throt_fp); | ~~~~~^~~~~~~~~~~~~~~~~~~~ -
acpitool.cpp:328:30: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 328 | fgets(str, 120, fp); | ~~~~~^~~~~~~~~~~~~~ -
battery.cpp:821:68: warning: ‘%s’ directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=] 821 | sprintf(filename[findex], "/sys/class/power_supply/%s/type", name); | ^~ -
battery.cpp:644:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 644 | strncpy(batt_info->Charge_Full_Design, "unknown", 7); | ^ -
battery.cpp:640:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 640 | strncpy(batt_info->Technology, "unknown", 7); | ^ -
battery.cpp:641:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 641 | strncpy(batt_info->Voltage_Now, "unknown", 7); | ^ -
battery.cpp:642:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 642 | strncpy(batt_info->Charge_Now, "unknown", 7); | ^ -
battery.cpp:643:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 643 | strncpy(batt_info->Charge_Full, "unknown", 7); | ^ -
battery.cpp:645:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 645 | strncpy(batt_info->Present_Rate, "unknown", 7); | ^ -
battery.cpp:646:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 646 | strncpy(batt_info->Design_Cap, "unknown", 7); | ^ -
battery.cpp:647:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 647 | strncpy(batt_info->LastFull_Cap, "unknown", 7); | ^ -
battery.cpp:648:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 648 | strncpy(batt_info->Remaining_Cap, "unknown", 7); | ^ -
battery.cpp:649:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 649 | strncpy(batt_info->Model, "unknown", 7); | ^ -
battery.cpp:650:16: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 650 | strncpy(batt_info->Serial, "unknown", 7); | ^ -
cpu.cpp:174:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 174 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:180:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 180 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:185:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 185 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:190:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 190 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:198:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 198 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:217:40: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 217 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:224:40: warning: ‘strncpy’ output may be truncated copying 2 bytes from a string of length 273 [-Wstringop-truncation] 224 | strncpy(temp, str+26, 2); | ^ -
cpu.cpp:233:40: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 274 [-Wstringop-truncation] 233 | strncpy(temp, str+25, 8); | ^ -
cpu.cpp:247:56: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 219 [-Wstringop-truncation] 247 | strncpy(temp, str+80, 8); | ^ -
cpu.cpp:289:44: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 289 | strncpy(temp, str+25, 5); | ^ -
cpu.cpp:293:44: warning: ‘strncpy’ output may be truncated copying 5 bytes from a string of length 274 [-Wstringop-truncation] 293 | strncpy(temp, str+25, 5); | ^ -
battery.cpp:569:56: warning: ‘%s’ directive writing up to 255 bytes into a region of size 76 [-Wformat-overflow=] 569 | sprintf(temp, "/sys/class/power_supply/%s/type", name); | ^~ -
battery.cpp:715:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 715 | strncpy(batt_info->Serial, temp, 12); | ^ -
battery.cpp:712:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 712 | strncpy(batt_info->Model, temp, 12); | ^ -
battery.cpp:709:32: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 99 [-Wstringop-truncation] 709 | strncpy(batt_info->Remaining_Cap, temp, 9); | ^ -
battery.cpp:704:32: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 99 [-Wstringop-truncation] 704 | strncpy(batt_info->LastFull_Cap, temp, 9); | ^ -
battery.cpp:699:32: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 99 [-Wstringop-truncation] 699 | strncpy(batt_info->Design_Cap, temp, 9); | ^ -
battery.cpp:694:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 694 | strncpy(batt_info->Charge_Full, temp, 12); | ^ -
battery.cpp:689:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 689 | strncpy(batt_info->Charge_Full_Design, temp, 12); | ^ -
battery.cpp:684:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 684 | strncpy(batt_info->Charge_Now, temp, 12); | ^ -
battery.cpp:679:32: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 99 [-Wstringop-truncation] 679 | strncpy(batt_info->Present_Rate, temp, 9); | ^ -
battery.cpp:673:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 673 | strncpy(batt_info->Voltage_Now, temp, 12); | ^ -
battery.cpp:668:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 668 | strncpy(batt_info->Technology, temp, 12); | ^ -
battery.cpp:665:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 665 | strncpy(batt_info->Bat_Type, temp, 12); | ^ -
battery.cpp:662:32: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 99 [-Wstringop-truncation] 662 | strncpy(batt_info->Charging_State, temp, 12); | ^ -
battery.cpp:734:16: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 99 [-Wstringop-truncation] 734 | strncpy(batt_info->Present_Rate, temp, 9); | ^ -
battery.cpp:507:71: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 507 | if (strncmp(batt_info->Charging_State,"unknown",7)==0) strncpy(batt_info->Charging_State, "charged",7); | ^ -
battery.cpp:516:74: warning: ‘strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation] 516 | if (strncmp(batt_info->Present_Rate, "unknown",7)==0) strncpy(batt_info->Present_Rate, "0 ",7); | ^ -
battery.cpp:386:67: warning: ‘%s’ directive writing up to 255 bytes into a region of size 241 [-Wformat-overflow=] 386 | sprintf(filename[findex], "/proc/acpi/battery/%s/info", name); | ^~ -
battery.cpp:390:67: warning: ‘%s’ directive writing up to 255 bytes into a region of size 176 [-Wformat-overflow=] 390 | sprintf(filename[findex], "/proc/acpi/battery/%s/state", name); | ^~ -
battery.cpp:446:16: warning: ‘strncpy’ output may be truncated copying 4 bytes from a string of length 74 [-Wstringop-truncation] 446 | strncpy(temp, str+25, 4); | ^ -
battery.cpp:457:16: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 74 [-Wstringop-truncation] 457 | strncpy(batt_info->Design_Cap, str+25, 9); | ^ -
battery.cpp:461:16: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 74 [-Wstringop-truncation] 461 | strncpy(batt_info->LastFull_Cap, str+25, 9); | ^ -
battery.cpp:475:16: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 74 [-Wstringop-truncation] 475 | strncpy(batt_info->Technology, str+25, 12); | ^ -
battery.cpp:481:16: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 74 [-Wstringop-truncation] 481 | strncpy(batt_info->Model, str+25, 12); | ^ -
battery.cpp:485:16: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 74 [-Wstringop-truncation] 485 | strncpy(batt_info->Serial, str+25, 12); | ^ -
battery.cpp:489:16: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 74 [-Wstringop-truncation] 489 | strncpy(batt_info->Bat_Type, str+25, 12); | ^ -
battery.cpp:506:16: warning: ‘strncpy’ output may be truncated copying 12 bytes from a string of length 74 [-Wstringop-truncation] 506 | strncpy(batt_info->Charging_State, str+25, 12); | ^ -
battery.cpp:513:16: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 74 [-Wstringop-truncation] 513 | strncpy(batt_info->Present_Rate, str+25, 9); | ^ -
battery.cpp:524:16: warning: ‘strncpy’ output may be truncated copying 9 bytes from a string of length 74 [-Wstringop-truncation] 524 | strncpy(batt_info->Remaining_Cap, str+25, 9); | ^ -
acpitool.cpp:408:40: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 14 [-Wstringop-truncation] 408 | strncpy(FAN_Status, str+25, 8); | ^ -
acpitool.cpp:380:70: warning: ‘%s’ directive writing up to 255 bytes into a region of size 185 [-Wformat-overflow=] 380 | sprintf(filename[fan_count], "/proc/acpi/fan/%s/state", name); | ^~ -
acpitool.cpp:89:20: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 24 [-Wstringop-truncation] 89 | strncpy(c, str+25,8); | ^ -
acpitool.cpp:100:20: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 49 [-Wstringop-truncation] 100 | strncpy(c, str,8); | ^ -
acpitool.cpp:259:90: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 231 [-Wformat-truncation=] 259 | snprintf(tmp_fname, sizeof (tmp_fname) - 1, "/proc/acpi/thermal_zone/%s/state", name); | ^~ -
acpitool.cpp:262:90: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 231 [-Wformat-truncation=] 262 | snprintf(tmp_fname, sizeof (tmp_fname) - 1, "/proc/acpi/thermal_zone/%s/temperature", name); | ^~ -
acpitool.cpp:265:90: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 231 [-Wformat-truncation=] 265 | snprintf(tmp_fname, sizeof (tmp_fname) - 1, "/proc/acpi/thermal_zone/%s/trip_points", name); | ^~