pyamsoft / pstate-frequency

Easily control Intel p-state driver on Linux
https://pyamsoft.blogspot.com/
GNU General Public License v2.0
172 stars 19 forks source link

Fails to build on Ubuntu 14.10 #3

Closed hotice closed 9 years ago

hotice commented 9 years ago

I'm running Ubuntu 14.10 64bit and pstate-frequency fails to build for me. Here's the complete log:

CFLAGS  =  -DDEBUG=0 -DVERSION="0.r.46.eb0ad58[cc]" -std=c99 -O2 -Wall -Wextra -Werror -Wmissing-prototypes -Wunreachable-code -I.
LDFLAGS =  -Wl,-O2,--sort-common,--as-needed,-z,relro,-s
CC      =  cc
cc -c src/mhz.c -o obj/mhz.o
cc -c src/cpu.c -o obj/cpu.o
cc -c src/main.c -o obj/main.o
src/cpu.c: In function ‘pyam_cpu_internal_get’:
src/cpu.c:365:5: error: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Werror=unused-result]
     getline(&line, &n, file);
     ^
src/cpu.c: In function ‘pyam_cpu_get_file_contents_str’:
src/cpu.c:96:5: error: ignoring return value of ‘getline’, declared with attribute warn_unused_result [-Werror=unused-result]
     getline(&line, &n, file);
     ^
src/cpu.c: In function ‘pyam_cpu_get_number’:
src/cpu.c:119:9: error: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Werror=unused-result]
         system(command);
         ^
src/cpu.c:120:9: error: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Werror=unused-result]
         system(readable);
         ^
cc1: all warnings being treated as errors
Makefile:23: recipe for target 'obj/cpu.o' failed
make: *** [obj/cpu.o] Error 1
make: *** Waiting for unfinished jobs....
pyamsoft commented 9 years ago

The code in question appears to raise an error because the return value of certain functions is not used. The -Werror flag makes these warnings turn into errors and as a result, causes the build to fail. Removing the -Werror flag from the config.mk file should fix the issue for the time being. This being said, I have updated the build which should hopefully mitigate this issue.

pyamsoft commented 9 years ago

Please attempt to test using a commit atleast as new as 0e3e0ed51c06ab19f26c1c9dd67c3237edf22337 (commit 55). Hopefully the problem is fixed in these later builds. I apologize about such a basic level error ruining a build.

hotice commented 9 years ago

It works after pulling commit 55, thanks!