Skip to contentSkip to conversation

Fix compilation bug in slirp code

PATCH In review Stefan Weil 2 participants 2 messages Nov 1, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation bug in slirp code

Hi,

tcpemu is a global variable (declared in slirp/misc.h). A later "static" declaration raises a compilation error with newer gcc versions. The patch fixes the declaration in slirp/tcp_subr.c.

Regards
Stefan

Index: slirp/tcp_subr.c
===================================================================
RCS file: /sources/qemu/qemu/slirp/tcp_subr.c,v
retrieving revision 1.12

tcp_subr.c +1 -1
diff -u -r1.12 tcp_subr.c
@@ -559,7 +559,7 @@
 	  {0, 0, 0, 0}
 };
 
-static struct emu_t *tcpemu = 0;
+struct emu_t *tcpemu;
 
 /*
  * Return TOS according to the above table
#1 lore raw
Quoted 6 lines · Stefan Weil

Hi,

tcpemu is a global variable (declared in slirp/misc.h). A later "static" declaration raises a compilation error with newer gcc versions. The patch fixes the declaration in slirp/tcp_subr.c.

The only user outside tcp_subr.c in misc.c is disabled with #ifdef CONFIG_QEMU, so I'll fix this by disabling the global definition in misc.h and 'static' keyword in tcp_subr.c with the same #ifdef.

Thanks anyways.