Closed frazei closed 4 years ago
Don't know why but adding -std=c99
in that line makes no difference.
Anyway I've added CFLAGS=-std=c99
at the beginning of Makefiles and now it compiles with a bunch of warnings:
cc -std=c99 -c -o timeout.o timeout.c timeout.c: In function ‘sleep_ms’: timeout.c:103:3: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] usleep(milliseconds * 1000); ^ timeout.c: In function ‘restart_xprintidle’: timeout.c:134:3: warning: implicit declaration of function ‘popen’ [-Wimplicit-function-declaration] fp = popen("sudo systemctl restart display-manager", "r"); ^ timeout.c:134:6: warning: assignment makes pointer from integer without a cast fp = popen("sudo systemctl restart display-manager", "r"); ^ timeout.c:141:3: warning: implicit declaration of function ‘pclose’ [-Wimplicit-function-declaration] pclose(fp); ^ timeout.c: In function ‘disable_xenergystar’: timeout.c:154:6: warning: assignment makes pointer from integer without a cast fp = popen((char *) final_command, "r"); ^ timeout.c: In function ‘get_idle_time’: timeout.c:176:6: warning: assignment makes pointer from integer without a cast fp = popen((char *) final_command, "r"); ^ timeout.c: In function ‘get_touch_screen_id’: timeout.c:226:6: warning: assignment makes pointer from integer without a cast fp = popen((char *) final_command, "r"); ^ timeout.c: In function ‘enable_touch_screen’: timeout.c:278:6: warning: assignment makes pointer from integer without a cast fp = popen((char *) final_command, "r"); ^ cc -o timeout timeout.o -lm -lpcre -std=c99
It works!