[BIRD 1.6.x] Unix: fix compilation with GCC 10
GCC 10 will now error when declaring a global variable twice: https://gcc.gnu.org/gcc-10/porting_to.html#common Fix this issue by declaring the variable as `extern' in `krt.h'. The variable is really declared in `krt.c'. LD -r -o all.o cf-parse.tab.o cf-lex.o conf.o /usr/bin/ld: cf-lex.o:/home/bernat/code/exoscale/bird/build~/conf/../lib/krt.h:115: multiple definition of `kif_proto'; cf-parse.tab.o:/home/bernat/code/exoscale/bird/build~/conf/../lib/krt.h:115: first defined here This issue was already fixed in BIRD 2.x. --- sysdep/unix/krt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index d4a8717e38ec..fe79efc3717d 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -112,7 +112,7 @@ struct kif_proto { struct kif_state sys; /* Sysdep state */ }; -struct kif_proto *kif_proto; +extern struct kif_proto *kif_proto; #define KIF_CF ((struct kif_config *)p->p.cf) -- 2.28.0
On Mon, Sep 28, 2020 at 03:01:12PM +0200, Vincent Bernat wrote:
GCC 10 will now error when declaring a global variable twice: https://gcc.gnu.org/gcc-10/porting_to.html#common
Fix this issue by declaring the variable as `extern' in `krt.h'. The variable is really declared in `krt.c'.
Thanks, merged. I noticed this issue in Debian bugreport mails, as they compile Testing with GCC 10. Unfortunately, GCC 10 is not in Backports. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Ondrej Zajicek -
Vincent Bernat