Mock Version: 2.15 Mock Version: 2.15 Mock Version: 2.15 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target riscv64 --nodeps /builddir/build/SPECS/acpitool.spec'], chrootPath='/var/lib/mock/f38-build-706983-91561/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=604800uid=991gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target riscv64 --nodeps /builddir/build/SPECS/acpitool.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: riscv64 Building for target riscv64 setting SOURCE_DATE_EPOCH=1674000000 Wrote: /builddir/build/SRPMS/acpitool-0.5.1-30.fc38.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target riscv64 --nodeps /builddir/build/SPECS/acpitool.spec'], chrootPath='/var/lib/mock/f38-build-706983-91561/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=604800uid=991gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target riscv64 --nodeps /builddir/build/SPECS/acpitool.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: riscv64 Building for target riscv64 setting SOURCE_DATE_EPOCH=1674000000 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.RHN0U7 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf acpitool-0.5.1 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/acpitool-0.5.1.tar.bz2 + STATUS=0 + '[' 0 -ne 0 ']' + cd acpitool-0.5.1 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + echo 'Patch #0 (ac_adapter.patch):' Patch #0 (ac_adapter.patch): + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .ac_adapter --fuzz=0 patching file src/ac_adapter.cpp Patch #1 (battery.patch): + echo 'Patch #1 (battery.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .battery --fuzz=0 patching file src/acpitool.h patching file src/battery.cpp Patch #2 (kernel3.patch): + echo 'Patch #2 (kernel3.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .kernel3 --fuzz=0 patching file src/acpitool.cpp Patch #3 (wakeup.patch): + echo 'Patch #3 (wakeup.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .wakeup --fuzz=0 patching file src/acpitool.cpp Patch #4 (var-line.patch): + echo 'Patch #4 (var-line.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .var-line --fuzz=0 patching file src/acpitool.cpp Patch #5 (typos.patch): + echo 'Patch #5 (typos.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .typos --fuzz=0 patching file man/acpitool.1 Patch #6 (cleanup.patch): + echo 'Patch #6 (cleanup.patch):' + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .cleanup --fuzz=0 patching file src/ac_adapter.cpp patching file src/acpitool.cpp patching file src/asus.cpp patching file src/battery.cpp patching file src/cpu.cpp patching file src/thinkpad.cpp patching file src/toshiba.cpp + echo 'Patch #7 (cache-size.patch):' Patch #7 (cache-size.patch): + /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .cache-size --fuzz=0 patching file src/cpu.cpp + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.gb265o + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd acpitool-0.5.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + '[' '-flto=auto -ffat-lto-objectsx' '!=' x ']' ++ find . -type f -name configure -print + for file in $(find . -type f -name configure -print) + /usr/bin/sed -r --in-place=.backup 's/^char \(\*f\) \(\) = /__attribute__ ((used)) char (*f) () = /g' ./configure + diff -u ./configure.backup ./configure + mv ./configure.backup ./configure + /usr/bin/sed -r --in-place=.backup 's/^char \(\*f\) \(\);/__attribute__ ((used)) char (*f) ();/g' ./configure + diff -u ./configure.backup ./configure + mv ./configure.backup ./configure + /usr/bin/sed -r --in-place=.backup 's/^char \$2 \(\);/__attribute__ ((used)) char \$2 ();/g' ./configure + diff -u ./configure.backup ./configure + mv ./configure.backup ./configure + /usr/bin/sed --in-place=.backup '1{$!N;$!N};$!N;s/int x = 1;\nint y = 0;\nint z;\nint nan;/volatile int x = 1; volatile int y = 0; volatile int z, nan;/;P;D' ./configure + diff -u ./configure.backup ./configure + mv ./configure.backup ./configure + /usr/bin/sed --in-place=.backup 's#^lt_cv_sys_global_symbol_to_cdecl=.*#lt_cv_sys_global_symbol_to_cdecl="sed -n -e '\''s/^T .* \\(.*\\)$/extern int \\1();/p'\'' -e '\''s/^$symcode* .* \\(.*\\)$/extern char \\1;/p'\''"#' ./configure + diff -u ./configure.backup ./configure + mv ./configure.backup ./configure + '[' 1 = 1 ']' +++ dirname ./configure ++ find . -name config.guess -o -name config.sub + for i in $(find $(dirname ./configure) -name config.guess -o -name config.sub) ++ basename ./config.sub + '[' -f /usr/lib/rpm/redhat/config.sub ']' + /usr/bin/rm -f ./config.sub ++ basename ./config.sub + /usr/bin/cp -fv /usr/lib/rpm/redhat/config.sub ./config.sub '/usr/lib/rpm/redhat/config.sub' -> './config.sub' + for i in $(find $(dirname ./configure) -name config.guess -o -name config.sub) ++ basename ./config.guess + '[' -f /usr/lib/rpm/redhat/config.guess ']' + /usr/bin/rm -f ./config.guess ++ basename ./config.guess + /usr/bin/cp -fv /usr/lib/rpm/redhat/config.guess ./config.guess '/usr/lib/rpm/redhat/config.guess' -> './config.guess' + '[' 1 = 1 ']' + '[' x '!=' 'x-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' ']' ++ find . -name ltmain.sh ++ grep -q runstatedir=DIR ./configure + ./configure --build=riscv64-redhat-linux-gnu --host=riscv64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... riscv64-redhat-linux-gnu checking host system type... riscv64-redhat-linux-gnu checking for C++ compiler default output file name... a.out checking whether the C++ compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... none checking for riscv64-redhat-linux-gnu-gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... none checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for unistd.h... (cached) yes checking for an ANSI C-conforming const... yes checking whether closedir returns void... no checking for strdup... yes checking for memset... yes checking for strtol... yes checking for a BSD-compatible install... /usr/bin/install -c configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating man/Makefile config.status: creating config.h config.status: executing depfiles commands +-----------------------------------------------------------------------------------+ | Run make && make install when the configure script has finished without problems. | +-----------------------------------------------------------------------------------+ + make -j4 make all-recursive make[1]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1' Making all in src make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/src' g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o main.o main.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o acpitool.o acpitool.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o ac_adapter.o ac_adapter.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o toshiba.o toshiba.cpp ac_adapter.cpp: In function 'int Do_AC_Info(int)': ac_adapter.cpp:54:27: warning: unused variable 'str' [-Wunused-variable] 54 | char filename[4][50], str[40]; | ^~~ ac_adapter.cpp: In function 'int Do_AC_Info_Sys()': ac_adapter.cpp:227:52: warning: format '%[^ ' expects a matching 'char*' argument [-Wformat=] 227 | sscanf(str, "%[^=]s %*s %[^\n]", attr); | ~~~^~ | | | char* ac_adapter.cpp:228:55: warning: format '%[^ ' expects a matching 'char*' argument [-Wformat=] 228 | sscanf(str, "%*[^=] %*c %s %[^\n]",temp); | ~~~^~ | | | char* 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); | ^~ In file included from /usr/include/stdio.h:906, from /usr/include/c++/13/cstdio:42, from /usr/include/c++/13/ext/string_conversions.h:45, from /usr/include/c++/13/bits/basic_string.h:4108, from /usr/include/c++/13/string:54, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from ac_adapter.cpp:35: In function 'sprintf', inlined from 'Do_AC_Info_Sys()' at ac_adapter.cpp:178:10: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 30 and 285 bytes into a destination of size 100 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ac_adapter.cpp: In function 'Do_AC_Info_Sys()': 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); | ^~ In function 'sprintf', inlined from 'Do_AC_Info_Sys()' at ac_adapter.cpp:191:12: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 32 and 287 bytes into a destination of size 130 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ acpitool.cpp: In function 'int Do_Thermal_Info(int, int)': 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); | ~~~~~^~~~~~~~~~~~~~ g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o asus.o asus.cpp ac_adapter.cpp: In function 'Do_AC_Info_Proc(int)': 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); | ^ 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); | ^~ In function 'sprintf', inlined from 'Do_AC_Info_Proc(int)' at ac_adapter.cpp:110:20: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 29 and 284 bytes into a destination of size 200 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ ac_adapter.cpp: In function 'Do_AC_Info(int)': 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); | ^~ In function 'sprintf', inlined from 'Do_AC_Info(int)' at ac_adapter.cpp:72:20: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 29 and 284 bytes into a destination of size 200 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o thinkpad.o thinkpad.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o cpu.o cpu.cpp acpitool.cpp: In function 'Do_Fan_Info(int)': 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); | ^~ In file included from /usr/include/stdio.h:906, from /usr/include/c++/13/cstdio:42, from /usr/include/c++/13/ext/string_conversions.h:45, from /usr/include/c++/13/bits/basic_string.h:4108, from /usr/include/c++/13/string:54, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from acpitool.cpp:37: In function 'sprintf', inlined from 'Do_Fan_Info(int)' at acpitool.cpp:380:11: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 22 and 277 bytes into a destination of size 200 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ acpitool.cpp: In function 'Has_ACPI(char*)': 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); | ^ g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o battery.o battery.cpp acpitool.cpp: In function 'Do_Thermal_Info(int, int)': 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); | ^~ In function 'snprintf', inlined from 'Do_Thermal_Info(int, int)' at acpitool.cpp:259:15: /usr/include/bits/stdio2.h:54:35: note: '__snprintf_chk' output between 31 and 286 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 ()); | ~~~~~~~~~~~~~~~~~ acpitool.cpp: In function 'Do_Thermal_Info(int, int)': 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); | ^~ In function 'snprintf', inlined from 'Do_Thermal_Info(int, int)' at acpitool.cpp:262:15: /usr/include/bits/stdio2.h:54:35: note: '__snprintf_chk' output between 37 and 292 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 ()); | ~~~~~~~~~~~~~~~~~ acpitool.cpp: In function 'Do_Thermal_Info(int, int)': 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); | ^~ In function 'snprintf', inlined from 'Do_Thermal_Info(int, int)' at acpitool.cpp:265:15: /usr/include/bits/stdio2.h:54:35: note: '__snprintf_chk' output between 37 and 292 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 ()); | ~~~~~~~~~~~~~~~~~ cpu.cpp: In function 'int Show_CPU_Info()': cpu.cpp:56:23: warning: variable 'bm_activity' set but not used [-Wunused-but-set-variable] 56 | long long int bm_activity; | ^~~~~~~~~~~ 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); | ~~~~~^~~~~~~~~~~~~~~~~~~~ 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); | ^ g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -c -o freq.o freq.cpp battery.cpp: In function 'int Do_Battery_Stuff(int, int, int)': battery.cpp:69:23: warning: variable 'Use_Sys' set but not used [-Wunused-but-set-variable] 69 | int Use_Proc = 0, Use_Sys = 0; | ^~~~~~~ battery.cpp: In function 'int Get_Battery_Info_from_Sys(int, Battery_Info*, int)': 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ 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: In function 'int Count_Batteries_SysFS()': 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 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); | ^~ In file included from /usr/include/stdio.h:906, from /usr/include/c++/13/cstdio:42, from /usr/include/c++/13/ext/string_conversions.h:45, from /usr/include/c++/13/bits/basic_string.h:4108, from /usr/include/c++/13/string:54, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from battery.cpp:38: In function 'sprintf', inlined from 'Count_Batteries_SysFS()' at battery.cpp:821:10: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 30 and 285 bytes into a destination of size 260 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ battery.cpp: In function 'Get_Battery_Info_from_Sys(int, Battery_Info*, int)': 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); | ^ 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); | ^~ In function 'sprintf', inlined from 'Get_Battery_Info_from_Sys(int, Battery_Info*, int)' at battery.cpp:569:10: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 30 and 285 bytes into a destination of size 100 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ battery.cpp: In function 'Get_Battery_Info_from_Sys(int, Battery_Info*, int)': 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); | ^ freq.cpp: In function 'int Get_Min_Freq()': 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: In function 'int Get_Max_Freq()': 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: In function 'int Get_Current_Freq()': 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ freq.cpp: In function 'int Get_Governor(char*)': 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ freq.cpp: In function 'int Get_Driver(char*)': 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ battery.cpp: In function 'Get_Battery_Info_from_Proc(int, Battery_Info*, int)': 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); | ^~ In function 'sprintf', inlined from 'Get_Battery_Info_from_Proc(int, Battery_Info*, int)' at battery.cpp:386:14: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 25 and 280 bytes into a destination of size 260 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ battery.cpp: In function 'Get_Battery_Info_from_Proc(int, Battery_Info*, int)': battery.cpp:390:67: warning: '%s' directive writing up to 255 bytes into a region of size 241 [-Wformat-overflow=] 390 | sprintf(filename[findex], "/proc/acpi/battery/%s/state", name); | ^~ In function 'sprintf', inlined from 'Get_Battery_Info_from_Proc(int, Battery_Info*, int)' at battery.cpp:390:14: /usr/include/bits/stdio2.h:30:34: note: '__sprintf_chk' output between 26 and 281 bytes into a destination of size 260 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ battery.cpp: In function 'Get_Battery_Info_from_Proc(int, Battery_Info*, int)': 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); | ^ g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -o acpitool main.o acpitool.o ac_adapter.o toshiba.o asus.o thinkpad.o cpu.o battery.o freq.o make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/src' Making all in man make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1' make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1' make[1]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.kIvb4k + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 ++ dirname /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd acpitool-0.5.1 + rm -fr /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 + make install DESTDIR=/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 Making install in src make[1]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/src' make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/src' test -z "/usr/bin" || mkdir -p -- "/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/bin" /usr/bin/install -c 'acpitool' '/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/bin/acpitool' make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/src' make[1]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/src' Making install in man make[1]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[2]: Nothing to be done for 'install-exec-am'. test -z "/usr/share/man/man1" || mkdir -p -- "/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/man/man1" /usr/bin/install -c -m 644 './acpitool.1' '/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/man/man1/acpitool.1' make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[1]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1/man' make[1]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1' make[2]: Entering directory '/builddir/build/BUILD/acpitool-0.5.1' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1' make[1]: Leaving directory '/builddir/build/BUILD/acpitool-0.5.1' + /usr/bin/find-debuginfo -j4 --strict-build-id -m -i --build-id-seed 0.5.1-30.fc38 --unique-debug-suffix -0.5.1-30.fc38.riscv64 --unique-debug-src-base acpitool-0.5.1-30.fc38.riscv64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 -S debugsourcefiles.list /builddir/build/BUILD/acpitool-0.5.1 extracting debug info from /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/bin/acpitool original debug info size: 1892kB, size after compression: 1724kB /usr/bin/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match. 215 blocks + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j4 + /usr/lib/rpm/redhat/brp-python-hardlink Processing files: acpitool-0.5.1-30.fc38.riscv64 Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.NKfytF + umask 022 + cd /builddir/build/BUILD + cd acpitool-0.5.1 + DOCDIR=/builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + export LC_ALL=C + LC_ALL=C + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr AUTHORS /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr ChangeLog /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr COPYING /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr INSTALL /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr README /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + cp -pr TODO /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64/usr/share/doc/acpitool + RPM_EC=0 ++ jobs -p + exit 0 Provides: acpitool = 0.5.1-30.fc38 acpitool(riscv-64) = 0.5.1-30.fc38 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: ld-linux-riscv64-lp64d.so.1()(64bit) ld-linux-riscv64-lp64d.so.1(GLIBC_2.27)(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.27)(64bit) libc.so.6(GLIBC_2.34)(64bit) libgcc_s.so.1()(64bit) libgcc_s.so.1(GCC_3.0)(64bit) libgcc_s.so.1(GCC_3.3.1)(64bit) libstdc++.so.6()(64bit) libstdc++.so.6(CXXABI_1.3)(64bit) libstdc++.so.6(CXXABI_1.3.9)(64bit) libstdc++.so.6(GLIBCXX_3.4)(64bit) libstdc++.so.6(GLIBCXX_3.4.11)(64bit) libstdc++.so.6(GLIBCXX_3.4.21)(64bit) libstdc++.so.6(GLIBCXX_3.4.29)(64bit) libstdc++.so.6(GLIBCXX_3.4.30)(64bit) libstdc++.so.6(GLIBCXX_3.4.9)(64bit) rtld(GNU_HASH) Processing files: acpitool-debugsource-0.5.1-30.fc38.riscv64 Provides: acpitool-debugsource = 0.5.1-30.fc38 acpitool-debugsource(riscv-64) = 0.5.1-30.fc38 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Processing files: acpitool-debuginfo-0.5.1-30.fc38.riscv64 Provides: acpitool-debuginfo = 0.5.1-30.fc38 acpitool-debuginfo(riscv-64) = 0.5.1-30.fc38 debuginfo(build-id) = 4a2c5b13d90efa59e0997d3983f9e5479a8be782 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Recommends: acpitool-debugsource(riscv-64) = 0.5.1-30.fc38 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 Wrote: /builddir/build/RPMS/acpitool-0.5.1-30.fc38.riscv64.rpm Wrote: /builddir/build/RPMS/acpitool-debugsource-0.5.1-30.fc38.riscv64.rpm Wrote: /builddir/build/RPMS/acpitool-debuginfo-0.5.1-30.fc38.riscv64.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.6Ii8xd + umask 022 + cd /builddir/build/BUILD + cd acpitool-0.5.1 + /usr/bin/rm -rf /builddir/build/BUILDROOT/acpitool-0.5.1-30.fc38.riscv64 + RPM_EC=0 ++ jobs -p + exit 0 Executing(rmbuild): /bin/sh -e /var/tmp/rpm-tmp.kQi9Ar + umask 022 + cd /builddir/build/BUILD + rm -rf acpitool-0.5.1 acpitool-0.5.1.gemspec + RPM_EC=0 ++ jobs -p + exit 0 Child return code was: 0