albfan / miraclecast

Connect external monitors to your system via Wifi-Display specification also known as Miracast
Other
3.66k stars 407 forks source link

Fails to build with GCC 14.1.1 with `error: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration]` #509

Closed dreirund closed 1 month ago

dreirund commented 1 month ago

With GCC 14.1.1, build fails:

[...]
ctl-cli.c: In function ‘cli_printf_time_prefix’:
ctl-cli.c:104:17: error: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration]
  104 |                 gettimeofday(&tv, NULL);
      |                 ^~~~~~~~~~~~
ctl-cli.c: In function ‘cli_printf_time_prefix’:
ctl-cli.c:104:17: error: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration]
  104 |                 gettimeofday(&tv, NULL);
      |                 ^~~~~~~~~~~~
make[3]: *** [Makefile:592: miracle_wifictl-ctl-cli.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:522: miracle_sinkctl-ctl-cli.o] Error 1
make[3]: Leaving directory '/var/cache/makepkg/build/miraclecast-nosystemd-git/src/miraclecast/src/ctl'
make[2]: *** [Makefile:539: all-recursive] Error 1
make[2]: Leaving directory '/var/cache/makepkg/build/miraclecast-nosystemd-git/src/miraclecast/src'
make[1]: *** [Makefile:423: all-recursive] Error 1
make[1]: Leaving directory '/var/cache/makepkg/build/miraclecast-nosystemd-git/src/miraclecast'
make: *** [Makefile:355: all] Error 2

Regards!

(Adding -Wno-error=implicit-function-declaration to CFLAGS / CXXFLAGS does work around the issue, but the code should be fixed.)

albfan commented 1 month ago

Fix by c83802f