Index: c/src/lib/libbsp/i386/ChangeLog
===================================================================
--- c/src/lib/libbsp/i386/ChangeLog	(revision adc829ed5f47c6893218e46702f2ab2ef2a76337)
+++ c/src/lib/libbsp/i386/ChangeLog	(revision 16cc328967c64c8c0bda99c1cdc0cf1a773c2c24)
@@ -1,2 +1,7 @@
+2005-01-19	Joel Sherrill <joel@OARcorp.com>
+
+	* pc386/console/vgainit.c, pc386/wd8003/wd8003.c, shared/comm/uart.c:
+	Fix errors caught by gcc 4.x.
+
 2004-09-24	Ralf Corsepius <ralf_corsepius@rtems.org>
 
Index: c/src/lib/libbsp/i386/pc386/console/vgainit.c
===================================================================
--- c/src/lib/libbsp/i386/pc386/console/vgainit.c	(revision adc829ed5f47c6893218e46702f2ab2ef2a76337)
+++ c/src/lib/libbsp/i386/pc386/console/vgainit.c	(revision 16cc328967c64c8c0bda99c1cdc0cf1a773c2c24)
@@ -171,5 +171,5 @@
 /* VGA 800x600 16-color graphics (BIOS mode 0x29).
  */
-static REGIO graphics_on[] = {
+REGIO graphics_on[] = {
   /* Reset attr F/F */
   IN, ATTRREG, 0, 0, 0,
Index: c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
===================================================================
--- c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c	(revision adc829ed5f47c6893218e46702f2ab2ef2a76337)
+++ c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c	(revision 16cc328967c64c8c0bda99c1cdc0cf1a773c2c24)
@@ -282,5 +282,6 @@
   unsigned int len;
   volatile unsigned char start, next, current;
-  char *shp, *temp;
+  unsigned char *shp, *temp;
+  unsigned short *real_short_ptr;
   rtems_event_set events;
 
@@ -309,7 +310,9 @@
 	break;
 
+      /* real_short_ptr avoids cast on lvalue which gcc no longer allows */
       shp = dp->base + 1 + (SHAPAGE * start);
       next = *shp++;
-      len = *((short *)shp)++ - 4;
+      real_short_ptr = (unsigned short *)shp;
+      len = *(real_short_ptr)++ - 4;
 
       if (next >= OUTPAGE){
Index: c/src/lib/libbsp/i386/shared/comm/uart.c
===================================================================
--- c/src/lib/libbsp/i386/shared/comm/uart.c	(revision adc829ed5f47c6893218e46702f2ab2ef2a76337)
+++ c/src/lib/libbsp/i386/shared/comm/uart.c	(revision 16cc328967c64c8c0bda99c1cdc0cf1a773c2c24)
@@ -832,5 +832,5 @@
 
 /* ================= GDB support     ===================*/
-static int sav[4] __attribute__ ((unused));
+int BSP_uart_dbgisr_com_regsav[4] __attribute__ ((unused));
 
 /*
@@ -846,7 +846,7 @@
 asm (".globl BSP_uart_dbgisr_com1");
 asm ("BSP_uart_dbgisr_com1:");
-asm ("    movl %eax, sav");          /* Save eax */
-asm ("    movl %ebx, sav + 4");      /* Save ebx */
-asm ("    movl %edx, sav + 8");      /* Save edx */
+asm ("    movl %eax, BSP_uart_dbgisr_com_regsav");          /* Save eax */
+asm ("    movl %ebx, BSP_uart_dbgisr_com_regsav + 4");      /* Save ebx */
+asm ("    movl %edx, BSP_uart_dbgisr_com_regsav + 8");      /* Save edx */
 
 asm ("    movl $0, %ebx");           /* Clear flag */
@@ -879,18 +879,18 @@
 
 /* Flag is set */
-asm ("   movl sav+4, %ebx");     /* Restore ebx */
-asm ("   movl sav+8, %edx");     /* Restore edx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+4, %ebx");     /* Restore ebx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+8, %edx");     /* Restore edx */
 
 /* Set TF bit */
-asm ("   popl  %eax");           /* Pop eip */
-asm ("   movl  %eax, sav + 4");  /* Save it */
-asm ("   popl  %eax");           /* Pop cs */
-asm ("   movl  %eax, sav + 8");  /* Save it */
-asm ("   popl  %eax");           /* Pop flags */
-asm ("   orl   $0x100, %eax");   /* Modify it */
-asm ("   pushl %eax");           /* Push it back */
-asm ("   movl  sav+8, %eax");    /* Put back cs */
+asm ("   popl  %eax");           			 /* Pop eip */
+asm ("   movl  %eax, BSP_uart_dbgisr_com_regsav + 4");  /* Save it */
+asm ("   popl  %eax");           			 /* Pop cs */
+asm ("   movl  %eax, BSP_uart_dbgisr_com_regsav + 8");  /* Save it */
+asm ("   popl  %eax");           			 /* Pop flags */
+asm ("   orl   $0x100, %eax");   			 /* Modify it */
+asm ("   pushl %eax");           			 /* Push it back */
+asm ("   movl  BSP_uart_dbgisr_com_regsav+8, %eax");    /* Put back cs */
 asm ("   pushl %eax");
-asm ("   movl  sav+4, %eax");    /* Put back eip */
+asm ("   movl  BSP_uart_dbgisr_com_regsav+4, %eax");    /* Put back eip */
 asm ("   pushl %eax");
 
@@ -898,16 +898,16 @@
 asm ("   movb  $0x20, %al");
 asm ("   outb  %al, $0x20");
-asm ("   movl  sav, %eax");      /* Restore eax */
-asm ("   iret");                 /* Done */
+asm ("   movl  BSP_uart_dbgisr_com_regsav, %eax");      /* Restore eax */
+asm ("   iret");                 			 /* Done */
 
 /* Flag is not set */
 asm("uart_dbgisr_com1_3:");
-asm ("   movl sav+4, %ebx");     /* Restore ebx */
-asm ("   movl sav+8, %edx");     /* Restore edx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+4, %ebx");     /* Restore ebx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+8, %edx");     /* Restore edx */
 
 /* Acknowledge irq */
 asm ("   movb  $0x20, %al");
 asm ("   outb  %al, $0x20");
-asm ("   movl  sav, %eax");      /* Restore eax */
+asm ("   movl  BSP_uart_dbgisr_com_regsav, %eax");      /* Restore eax */
 asm ("   iret");                 /* Done */
 
@@ -923,7 +923,7 @@
 asm (".globl BSP_uart_dbgisr_com2");
 asm ("BSP_uart_dbgisr_com2:");
-asm ("    movl %eax, sav");          /* Save eax */
-asm ("    movl %ebx, sav + 4");      /* Save ebx */
-asm ("    movl %edx, sav + 8");      /* Save edx */
+asm ("    movl %eax, BSP_uart_dbgisr_com_regsav");          /* Save eax */
+asm ("    movl %ebx, BSP_uart_dbgisr_com_regsav + 4");      /* Save ebx */
+asm ("    movl %edx, BSP_uart_dbgisr_com_regsav + 8");      /* Save edx */
 
 asm ("    movl $0, %ebx");           /* Clear flag */
@@ -956,18 +956,18 @@
 
 /* Flag is set */
-asm ("   movl sav+4, %ebx");     /* Restore ebx */
-asm ("   movl sav+8, %edx");     /* Restore edx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+4, %ebx");     /* Restore ebx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+8, %edx");     /* Restore edx */
 
 /* Set TF bit */
 asm ("   popl  %eax");           /* Pop eip */
-asm ("   movl  %eax, sav + 4");  /* Save it */
+asm ("   movl  %eax, BSP_uart_dbgisr_com_regsav + 4");  /* Save it */
 asm ("   popl  %eax");           /* Pop cs */
-asm ("   movl  %eax, sav + 8");  /* Save it */
+asm ("   movl  %eax, BSP_uart_dbgisr_com_regsav + 8");  /* Save it */
 asm ("   popl  %eax");           /* Pop flags */
 asm ("   orl   $0x100, %eax");   /* Modify it */
 asm ("   pushl %eax");           /* Push it back */
-asm ("   movl  sav+8, %eax");    /* Put back cs */
+asm ("   movl  BSP_uart_dbgisr_com_regsav+8, %eax");    /* Put back cs */
 asm ("   pushl %eax");
-asm ("   movl  sav+4, %eax");    /* Put back eip */
+asm ("   movl  BSP_uart_dbgisr_com_regsav+4, %eax");    /* Put back eip */
 asm ("   pushl %eax");
 
@@ -975,15 +975,15 @@
 asm ("   movb  $0x20, %al");
 asm ("   outb  %al, $0x20");
-asm ("   movl  sav, %eax");      /* Restore eax */
+asm ("   movl  BSP_uart_dbgisr_com_regsav, %eax");      /* Restore eax */
 asm ("   iret");                 /* Done */
 
 /* Flag is not set */
 asm("uart_dbgisr_com2_3:");
-asm ("   movl sav+4, %ebx");     /* Restore ebx */
-asm ("   movl sav+8, %edx");     /* Restore edx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+4, %ebx");     /* Restore ebx */
+asm ("   movl BSP_uart_dbgisr_com_regsav+8, %edx");     /* Restore edx */
 
 /* Acknowledge irq */
 asm ("   movb  $0x20, %al");
 asm ("   outb  %al, $0x20");
-asm ("   movl  sav, %eax");      /* Restore eax */
+asm ("   movl  BSP_uart_dbgisr_com_regsav, %eax");      /* Restore eax */
 asm ("   iret");                 /* Done */
