Skip to contentSkip to conversation

fix build of gdbstub.c

PATCH In review Charles Coffing 2 participants 2 messages Sep 25, 2006 – Sep 26, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix build of gdbstub.c

Changeset 11598 broke the build with my gcc-4.1.2. You can't forward-declare a static function within another function. Trivial patch attached to fix this.

gcc -O1 -fno-omit-frame-pointer -g -m32 -march=i686 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix include -Werror -Wno-pointer-arith -pipe -I/usr/src/packages/BUILD/xen-unstable/xen/include -I/usr/src/packages/BUILD/xen-unstable/xen/include/asm-x86/mach-generic -I/usr/src/packages/BUILD/xen-unstable/xen/include/asm-x86/mach-default -msoft-float -g -D__XEN__ -DVERBOSE -DCRASH_DEBUG -c gdbstub.c -o gdbstub.o gdbstub.c: In function ‘gdbstub_attach’:
gdbstub.c:363: error: invalid storage class for function ‘gdbstub_console_puts’
gdbstub.c:367: error: ‘gdbstub_console_puts’ undeclared (first use in this function)
gdbstub.c:367: error: (Each undeclared identifier is reported only once
gdbstub.c:367: error: for each function it appears in.)
make[4]: *** [gdbstub.o] Error 1

xen/common/gdbstub.c +1 -1
Index: xen-unstable/xen/common/gdbstub.c
===================================================================
@@ -357,10 +357,10 @@ gdb_cmd_write_mem(unsigned long addr, un
     gdb_send_packet(ctx);
 }
 
+static void gdbstub_console_puts(const char *str);
 static void
 gdbstub_attach(struct gdb_context *ctx)
 {
-    static void gdbstub_console_puts(const char *str);
     if ( ctx->currently_attached )
         return;    
     ctx->currently_attached = 1;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Charles Coffing

Changeset 11598 broke the build with my gcc-4.1.2. You can't forward-declare a static function within another function. Trivial patch attached to fix this.

While you're in there, it would be nice to do this right and move the declaration to a header file so that it doesn't eventually (but certainly) get out of sync...

Cheers,
Muli