Bumblebee-Project / bbswitch

Disable discrete graphics (currently nvidia only)
GNU General Public License v2.0
487 stars 78 forks source link

Implicit Function Declarations causing make to fail #209

Closed nicklauscyc closed 3 years ago

nicklauscyc commented 3 years ago

due to implicit function declarations of proc_create and remove_proc_entry, make fails since warnings treated as errors

make -C /lib/modules/5.9.14-arch1-1/build M="$(pwd)" modules
make[1]: Entering directory '/usr/lib/modules/5.9.14-arch1-1/build'
  CC [M]  /home/nicklaus/Repositories/bbswitch/bbswitch.o
/home/nicklaus/Repositories/bbswitch/bbswitch.c: In function ‘bbswitch_init’:
/home/nicklaus/Repositories/bbswitch/bbswitch.c:460:18: error: implicit declaration of function ‘proc_create’ [-Werror=implicit-function-declaration]
  460 |     acpi_entry = proc_create("bbswitch", 0664, acpi_root_dir, &bbswitch_fops);
      |                  ^~~~~~~~~~~
/home/nicklaus/Repositories/bbswitch/bbswitch.c:460:16: warning: assignment to ‘struct proc_dir_entry *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  460 |     acpi_entry = proc_create("bbswitch", 0664, acpi_root_dir, &bbswitch_fops);
      |                ^
/home/nicklaus/Repositories/bbswitch/bbswitch.c: In function ‘bbswitch_exit’:
/home/nicklaus/Repositories/bbswitch/bbswitch.c:490:5: error: implicit declaration of function ‘remove_proc_entry’ [-Werror=implicit-function-declaration]
  490 |     remove_proc_entry("bbswitch", acpi_root_dir);
      |     ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:283: /home/nicklaus/Repositories/bbswitch/bbswitch.o] Error 1
make[1]: *** [Makefile:1784: /home/nicklaus/Repositories/bbswitch] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.9.14-arch1-1/build'
make: *** [Makefile:13: default] Error 2