Warnings cleanup.
diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c
index 7c23c46..57c3bdf 100644
--- a/frontends/tasm/tasm-options.c
+++ b/frontends/tasm/tasm-options.c
@@ -102,14 +102,13 @@
 void
 help_msg(const char *msg, const char *tail, opt_option *options, size_t nopts)
 {
-    char optbuf[100], optopt[100];
+    char optbuf[100];
     size_t i;
 
     printf("%s", gettext(msg));
 
     for (i = 0; i < nopts; i++) {
         optbuf[0] = 0;
-        optopt[0] = 0;
 
         if (options[i].takes_param) {
             if (options[i].opt)
diff --git a/libyasm/section.c b/libyasm/section.c
index 8ad7dea..ba582bf 100644
--- a/libyasm/section.c
+++ b/libyasm/section.c
@@ -1315,12 +1315,10 @@
         unsigned long offset = 0;
 
         yasm_bytecode *bc = STAILQ_FIRST(&sect->bcs);
-        yasm_bytecode *prevbc;
 
         bc->bc_index = bc_index++;
 
         /* Skip our locally created empty bytecode first. */
-        prevbc = bc;
         bc = STAILQ_NEXT(bc, link);
 
         /* Iterate through the remainder, if any. */
@@ -1358,7 +1356,6 @@
                 offset += bc->len*bc->mult_int;
             }
 
-            prevbc = bc;
             bc = STAILQ_NEXT(bc, link);
         }
     }
diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c
index 85feb78..e9ddcce 100644
--- a/modules/arch/x86/x86expr.c
+++ b/modules/arch/x86/x86expr.c
@@ -644,7 +644,7 @@
          (x86_ea->need_sib && !x86_ea->valid_sib))) {
         int i;
         unsigned char low3;
-        typedef enum {
+        enum {
             REG3264_NONE = -1,
             REG3264_EAX = 0,
             REG3264_ECX,
@@ -664,7 +664,7 @@
             REG64_R15,
             REG64_RIP,
             SIMDREGS
-        } reg3264type;
+        };
         int reg3264mult[33] =
             {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c
index 151dc19..10bb2f2 100644
--- a/modules/dbgfmts/dwarf2/dwarf2-line.c
+++ b/modules/dbgfmts/dwarf2/dwarf2-line.c
@@ -691,7 +691,7 @@
     dwarf2_line_info info;
     int new;
     size_t i;
-    yasm_bytecode *last, *sppbc;
+    yasm_bytecode *sppbc;
     dwarf2_spp *spp;
     dwarf2_head *head;
 
@@ -709,7 +709,6 @@
     info.dbgfmt_dwarf2 = dbgfmt_dwarf2;
     info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0,
                                               &new, 0);
-    last = yasm_section_bcs_last(info.debug_line);
 
     /* header */
     head = yasm_dwarf2__add_head(dbgfmt_dwarf2, info.debug_line, NULL, 0, 0);
diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c
index c8cf9b3..5c0cba6 100644
--- a/modules/dbgfmts/stabs/stabs-dbgfmt.c
+++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c
@@ -316,7 +316,7 @@
     int new;
     yasm_bytecode *dbgbc;
     stabs_stab *stab;
-    yasm_bytecode *filebc, *nullbc, *laststr, *firstbc;
+    yasm_bytecode *filebc, *laststr, *firstbc;
     yasm_symrec *firstsym;
     yasm_section *stext;
 
@@ -371,7 +371,7 @@
     yasm_section_bcs_append(info.stab, dbgbc);
 
     /* initial strtab bytecodes */
-    nullbc = stabs_dbgfmt_append_bcstr(info.stabstr, "");
+    stabs_dbgfmt_append_bcstr(info.stabstr, "");
     filebc = stabs_dbgfmt_append_bcstr(info.stabstr, object->src_filename);
 
     stext = yasm_object_find_general(object, ".text");
diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c
index 2e96aeb..b1987ac 100644
--- a/modules/objfmts/coff/coff-objfmt.c
+++ b/modules/objfmts/coff/coff-objfmt.c
@@ -524,12 +524,9 @@
         if (vis & YASM_SYM_COMMON) {
             /* In standard COFF, COMMON symbols have their length added in */
             if (!objfmt_coff->win32) {
-                /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd;
                 /*@dependent@*/ /*@null@*/ yasm_expr **csize_expr;
                 /*@dependent@*/ /*@null@*/ yasm_intnum *common_size;
 
-                csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb);
-                assert(csymd != NULL);
                 csize_expr = yasm_symrec_get_common_size(sym);
                 assert(csize_expr != NULL);
                 common_size = yasm_expr_get_intnum(csize_expr, 1);
diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c
index addec91..2486bba 100644
--- a/modules/objfmts/elf/elf.c
+++ b/modules/objfmts/elf/elf.c
@@ -82,7 +82,7 @@
          elf_march != NULL;
          elf_march = elf_machine_handlers[++i])
     {
-        if (yasm__strcasecmp(yasm_arch_keyword(arch), elf_march->arch)==0)
+        if (yasm__strcasecmp(yasm_arch_keyword(arch), elf_march->arch)==0) {
             if (yasm__strcasecmp(machine, elf_march->machine)==0) {
                 if (bits_pref == 0 || bits_pref == elf_march->bits)
                     break;
@@ -90,6 +90,7 @@
                        && yasm__strcasecmp(machine, "amd64") == 0
                        && yasm__strcasecmp(elf_march->machine, "x32") == 0)
                 break;
+        }
     }
 
     if (elf_march && elf_march->num_ssyms > 0)
@@ -468,13 +469,12 @@
                          yasm_errwarns *errwarns)
 {
     unsigned char buf[SYMTAB_MAXSIZE], *bufp;
-    elf_symtab_entry *entry, *prev;
+    elf_symtab_entry *entry;
     unsigned long size = 0;
 
     if (!symtab)
         yasm_internal_error(N_("symtab is null"));
 
-    prev = NULL;
     STAILQ_FOREACH(entry, symtab, qlink) {
 
         yasm_intnum *size_intn=NULL, *value_intn=NULL;
@@ -537,8 +537,6 @@
 
         yasm_intnum_destroy(size_intn);
         yasm_intnum_destroy(value_intn);
-
-        prev = entry;
     }
     return size;
 }
@@ -788,7 +786,6 @@
 
 
     while (reloc) {
-        yasm_sym_vis vis;
         unsigned int r_type=0, r_sym;
         elf_symtab_entry *esym;
 
@@ -798,7 +795,6 @@
         else
             r_sym = STN_UNDEF;
 
-        vis = yasm_symrec_get_visibility(reloc->reloc.sym);
         if (!elf_march->map_reloc_info_to_type)
             yasm_internal_error(N_("Unsupported arch/machine for elf output"));
         r_type = elf_march->map_reloc_info_to_type(reloc);
diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c
index 1b00918..0a48d9b 100644
--- a/modules/objfmts/macho/macho-objfmt.c
+++ b/modules/objfmts/macho/macho-objfmt.c
@@ -730,12 +730,10 @@
 macho_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d)
 {
     /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d;
-    yasm_objfmt_macho *objfmt_macho;
     /*@dependent@*/ /*@null@*/ macho_section_data *msd;
     unsigned char *localbuf;
 
     assert(info != NULL);
-    objfmt_macho = info->objfmt_macho;
     msd = yasm_section_get_data(sect, &macho_section_data_cb);
     assert(msd != NULL);
 
@@ -970,8 +968,6 @@
 {
     /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d;
     yasm_sym_vis vis = yasm_symrec_get_visibility(sym);
-    /*@null@*/ macho_symrec_data *xsymd;
-
 
     assert(info != NULL);
 
@@ -982,7 +978,6 @@
                 yasm_symrec_get_global_name(sym, info->object);
             size_t len = strlen(name);
 
-            xsymd = yasm_symrec_get_data(sym, &macho_symrec_data_cb);
             fwrite(name, len + 1, 1, info->f);
             yasm_xfree(name);
         }
@@ -1037,7 +1032,7 @@
     unsigned long symtab_count = 0;
     unsigned long headsize;
     unsigned int macho_segcmdsize, macho_sectcmdsize, macho_nlistsize;
-    unsigned int macho_relinfosize, macho_segcmd;
+    unsigned int macho_segcmd;
     unsigned int head_ncmds, head_sizeofcmds;
     unsigned long fileoffset, fileoff_sections;
     yasm_intnum *val;
@@ -1072,7 +1067,6 @@
         macho_segcmdsize = MACHO_SEGCMD64_SIZE;
         macho_sectcmdsize = MACHO_SECTCMD64_SIZE;
         macho_nlistsize = MACHO_NLIST64_SIZE;
-        macho_relinfosize = MACHO_RELINFO64_SIZE;
         long_int_bytes = 8;
     } else {
         headsize =
@@ -1083,7 +1077,6 @@
         macho_segcmdsize = MACHO_SEGCMD_SIZE;
         macho_sectcmdsize = MACHO_SECTCMD_SIZE;
         macho_nlistsize = MACHO_NLIST_SIZE;
-        macho_relinfosize = MACHO_RELINFO_SIZE;
         long_int_bytes = 4;
     }
 
diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c
index d081fc5..eb3c666 100644
--- a/modules/objfmts/rdf/rdf-objfmt.c
+++ b/modules/objfmts/rdf/rdf-objfmt.c
@@ -183,7 +183,6 @@
                         yasm_bytecode *bc, int warn, /*@null@*/ void *d)
 {
     /*@null@*/ rdf_objfmt_output_info *info = (rdf_objfmt_output_info *)d;
-    yasm_objfmt_rdf *objfmt_rdf;
     /*@dependent@*/ /*@null@*/ yasm_intnum *intn;
     unsigned long intn_minus;
     unsigned long intn_plus;
@@ -191,7 +190,6 @@
     unsigned int valsize = value->size;
 
     assert(info != NULL);
-    objfmt_rdf = info->objfmt_rdf;
 
     if (value->abs)
         value->abs = yasm_expr_simplify(value->abs, 1);
diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c
index aac6e77..9ad0e60 100644
--- a/modules/objfmts/xdf/xdf-objfmt.c
+++ b/modules/objfmts/xdf/xdf-objfmt.c
@@ -149,14 +149,12 @@
                         yasm_bytecode *bc, int warn, /*@null@*/ void *d)
 {
     /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d;
-    yasm_objfmt_xdf *objfmt_xdf;
     /*@dependent@*/ /*@null@*/ yasm_intnum *intn;
     unsigned long intn_minus;
     int retval;
     unsigned int valsize = value->size;
 
     assert(info != NULL);
-    objfmt_xdf = info->objfmt_xdf;
 
     if (value->abs)
         value->abs = yasm_expr_simplify(value->abs, 1);
@@ -375,13 +373,11 @@
 xdf_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d)
 {
     /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d;
-    yasm_objfmt_xdf *objfmt_xdf;
     /*@dependent@*/ /*@null@*/ xdf_section_data *xsd;
     /*@null@*/ xdf_symrec_data *xsymd;
     unsigned char *localbuf;
 
     assert(info != NULL);
-    objfmt_xdf = info->objfmt_xdf;
     xsd = yasm_section_get_data(sect, &xdf_section_data_cb);
     assert(xsd != NULL);