i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
921 stars 404 forks source link

unlock_indicator.c: fix build failure against gcc-10 #259

Closed trofi closed 4 years ago

trofi commented 4 years ago

On gcc-10 (and gcc-9 -fno-common) build fails as:

  CCLD     i3lock
ld: i3lock-unlock_indicator.o:i3lock/unlock_indicator.c:38:
  multiple definition of `input_position'; i3lock-i3lock.o:i3lock/i3lock.c:69: first defined here
ld: i3lock-unlock_indicator.o:(.bss+0x102): multiple definition of `__odr_asan.input_position'; i3lock-i3lock.o:(.bss+0x92b): first defined here

gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678.

The error also happens if CFLAGS=-fno-common passed explicitly.

Reported-by: Hans de Graaff Bug: https://bugs.gentoo.org/706286

orestisfl commented 4 years ago

Thanks