diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog
index aa4ce730..100446aa 100644
--- a/avrdude/ChangeLog
+++ b/avrdude/ChangeLog
@@ -1,3 +1,13 @@
+2013-09-03  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	* fileio.c: Fix "unused variable" warnings.
+	* avr.c: (Dito.)
+	* stk500v2.c: (Dito.)
+	* stk500.c: (Dito.)
+	* jtagmkII.c: (Dito.)
+	* term.c: (Dito.)
+	* ser_posix.c: (Dito.)
+
 2013-09-02  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
 
 	Submitted by Travis Griggs:
diff --git a/avrdude/avr.c b/avrdude/avr.c
index fe7f12c1..37f961b4 100644
--- a/avrdude/avr.c
+++ b/avrdude/avr.c
@@ -47,10 +47,9 @@ int avr_tpi_poll_nvmbsy(PROGRAMMER *pgm)
 {
   unsigned char cmd;
   unsigned char res;
-  int rc = 0;
 
   cmd = TPI_CMD_SIN | TPI_SIO_ADDR(TPI_IOREG_NVMCSR);
-  rc = pgm->cmd_tpi(pgm, &cmd, 1, &res, 1);
+  (void)pgm->cmd_tpi(pgm, &cmd, 1, &res, 1);
   return (res & TPI_IOREG_NVMCSR_NVMBSY);
 }
 
diff --git a/avrdude/fileio.c b/avrdude/fileio.c
index ffd112a2..92003a5d 100644
--- a/avrdude/fileio.c
+++ b/avrdude/fileio.c
@@ -1033,8 +1033,8 @@ static int elf2b(char * infile, FILE * inf,
       while ((d = elf_getdata(s, d)) != NULL) {
         if (verbose >= 2) {
           fprintf(stderr,
-                  "    Data block: d_buf 0x%x, d_off 0x%x, d_size %d\n",
-                  (unsigned int)d->d_buf, (unsigned int)d->d_off, d->d_size);
+                  "    Data block: d_buf %p, d_off 0x%x, d_size %d\n",
+                  d->d_buf, (unsigned int)d->d_off, d->d_size);
         }
         if (mem->size == 1) {
           if (d->d_off != 0) {
diff --git a/avrdude/jtagmkII.c b/avrdude/jtagmkII.c
index bd8a12ea..d84c3c39 100644
--- a/avrdude/jtagmkII.c
+++ b/avrdude/jtagmkII.c
@@ -2890,7 +2890,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
   int status, j, lineno;
   unsigned char *resp, buf[3];
   unsigned long val=0;
-  unsigned long config0, config1;
 
   if(verbose) fprintf(stderr,
           "%s: jtagmkII_reset32(%2.2x)\n",
@@ -2995,7 +2994,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
 
     val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
     if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
-    config0 = val;  // 0x0204098b
 
     status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
     if(status < 0) {lineno = __LINE__; goto eRR;}
@@ -3025,7 +3023,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
     if(val != 0x00000001) {lineno = __LINE__; goto eRR;}
     val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
     if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
-    config1 = val;  // 0x00800000
 
     status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
     if(status < 0) {lineno = __LINE__; goto eRR;}
@@ -3055,7 +3052,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
 
     val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
     if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
-    config0 = val;  // 0x0204098b
 
     status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
     if(status < 0) {lineno = __LINE__; goto eRR;}
diff --git a/avrdude/ser_posix.c b/avrdude/ser_posix.c
index 5bbd010f..7a85085d 100644
--- a/avrdude/ser_posix.c
+++ b/avrdude/ser_posix.c
@@ -314,7 +314,6 @@ static void ser_close(union filedescriptor *fd)
 
 static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen)
 {
-  struct timeval timeout, to2;
   int rc;
   unsigned char * p = buf;
   size_t len = buflen;
@@ -343,10 +342,6 @@ static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen
       fprintf(stderr, "\n");
   }
 
-  timeout.tv_sec = 0;
-  timeout.tv_usec = 500000;
-  to2 = timeout;
-
   while (len) {
     rc = write(fd->ifd, p, (len > 1024) ? 1024 : len);
     if (rc < 0) {
diff --git a/avrdude/stk500.c b/avrdude/stk500.c
index 2719b939..a1f502bd 100644
--- a/avrdude/stk500.c
+++ b/avrdude/stk500.c
@@ -751,15 +751,12 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
   int tries;
   unsigned int n;
   unsigned int i;
-  int flash;
 
   if (strcmp(m->desc, "flash") == 0) {
     memtype = 'F';
-    flash = 1;
   }
   else if (strcmp(m->desc, "eeprom") == 0) {
     memtype = 'E';
-    flash = 0;
   }
   else {
     return -2;
diff --git a/avrdude/stk500v2.c b/avrdude/stk500v2.c
index bfd95c08..9ee51132 100644
--- a/avrdude/stk500v2.c
+++ b/avrdude/stk500v2.c
@@ -2258,7 +2258,7 @@ static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                                 unsigned int page_size,
                                 unsigned int addr, unsigned int n_bytes)
 {
-  unsigned int block_size, last_addr, hiaddr, addrshift, use_ext_addr;
+  unsigned int block_size, last_addr, addrshift, use_ext_addr;
   unsigned int maxaddr = addr + n_bytes;
   unsigned char commandbuf[10];
   unsigned char buf[266];
@@ -2270,7 +2270,6 @@ static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
         m->desc, page_size, addr, n_bytes);
 
   if (page_size == 0) page_size = 256;
-  hiaddr = UINT_MAX;
   addrshift = 0;
   use_ext_addr = 0;
 
@@ -2391,7 +2390,7 @@ static int stk500hv_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                                 unsigned int addr, unsigned int n_bytes,
                                 enum hvmode mode)
 {
-  unsigned int block_size, last_addr, hiaddr, addrshift, use_ext_addr;
+  unsigned int block_size, last_addr, addrshift, use_ext_addr;
   unsigned int maxaddr = addr + n_bytes;
   unsigned char commandbuf[5], buf[266];
   int result;
@@ -2399,7 +2398,6 @@ static int stk500hv_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
   DEBUG("STK500V2: stk500hv_paged_write(..,%s,%u,%u)\n",
         m->desc, page_size, addr, n_bytes);
 
-  hiaddr = UINT_MAX;
   addrshift = 0;
   use_ext_addr = 0;
 
diff --git a/avrdude/term.c b/avrdude/term.c
index b88d06a8..fef870d1 100644
--- a/avrdude/term.c
+++ b/avrdude/term.c
@@ -206,13 +206,12 @@ static int chardump_line(char * buffer, unsigned char * p, int n, int pad)
 static int hexdump_buf(FILE * f, int startaddr, unsigned char * buf, int len)
 {
   int addr;
-  int i, n;
+  int n;
   unsigned char * p;
   char dst1[80];
   char dst2[80];
 
   addr = startaddr;
-  i = 0;
   p = (unsigned char *)buf;
   while (len) {
     n = 16;