diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index defaba5a7b39fdd0df3aef598dc630d3d0ea3344..bb26e890a7e7cd455e980a5d192d6c91649d653a 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -842,6 +842,7 @@ PMOD_EXPORT void f_random_seed(INT32 args)
 {
   INT_TYPE i;
   check_all_args("random_seed",args,BIT_INT | BIT_OBJECT, 0);
+
   if(TYPEOF(Pike_sp[-args]) == T_INT)
   {
     i=Pike_sp[-args].u.integer;
@@ -5256,7 +5257,7 @@ PMOD_EXPORT void f_rows(INT32 args)
  *! @seealso
  *!   @[next_object()]
  */
-static void f_map_all_objects( INT32 args )
+static void f_map_all_objects( INT32 UNUSED(args) )
 {
     struct object *o = first_object;
     INT32 total = 0;
@@ -7789,7 +7790,7 @@ unsigned int rec_size_svalue( struct svalue *s, struct mapping **m )
  *! @seealso
  *!   @[lfun::_size_object()], @[sizeof()]
  */
-static void f__size_object( INT32 args )
+static void f__size_object( INT32 UNUSED(args) )
 {
     size_t sum;
     unsigned int i;
diff --git a/src/error.c b/src/error.c
index 4b8199c92fee19a2e9f2e1a2f58f45a3f2724a63..f617cedf7f5b1cc1014644c811278526f60c62d5 100644
--- a/src/error.c
+++ b/src/error.c
@@ -1089,7 +1089,7 @@ PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expe
 }
 
 #ifdef PIKE_DEBUG
-static void gc_check_throw_value(struct callback *foo, void *bar, void *gazonk)
+static void gc_check_throw_value(struct callback *UNUSED(foo), void *UNUSED(bar), void *UNUSED(gazonk))
 {
   gc_mark_external_svalues(&throw_value,1," in the throw value");
 }
diff --git a/src/gc.c b/src/gc.c
index 6fab1cbbffed4bbfeac92d101a6e9076c6c50884..8a4a86a23449728ff4845952766a87db22f042b8 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -1075,9 +1075,12 @@ static void dloc_gc_fatal (const char *file, INT_TYPE line,
   va_end (args);
 }
 
-static void rec_stack_fatal (struct gc_rec_frame *err, const char *err_name,
-			     struct gc_rec_frame *p1, const char *p1n,
-			     struct gc_rec_frame *p2, const char *p2n,
+static void rec_stack_fatal (struct gc_rec_frame *DEBUGUSED(err),
+                             const char *DEBUGUSED(err_name),
+                             struct gc_rec_frame *DEBUGUSED(p1), 
+                             const char *DEBUGUSED(p1n),
+                             struct gc_rec_frame *DEBUGUSED(p2), 
+                             const char *DEBUGUSED(p2n),
 			     const char *file, INT_TYPE line,
 			     const char *fmt, ...)
 {
diff --git a/src/interpret.c b/src/interpret.c
index b5e3f7e51141314a321a2be249a34733a409db7e..97fa76b8f6919a9c9fe9242f3bd4ee110bfa65f2 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -172,7 +172,7 @@ void gc_mark_stack_external (struct pike_frame *f,
     gc_mark_external_svalues (stack, stack_p - stack, " on svalue stack");
 }
 
-static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk)
+static void gc_check_stack_callback(struct callback *UNUSED(foo), void *UNUSED(bar), void *UNUSED(gazonk))
 {
   if (Pike_interpreter.evaluator_stack
 #ifdef PIKE_DEBUG
diff --git a/src/modules/DVB/dvb.c b/src/modules/DVB/dvb.c
index 36a7f98e8c6ccf7464b03053e1bc00666f119e8a..25efea341e7681f0226643b7f486621f6ee72cbc 100644
--- a/src/modules/DVB/dvb.c
+++ b/src/modules/DVB/dvb.c
@@ -801,7 +801,7 @@ static int read_t(int fd,unsigned char *buffer,int length,int cks)
       return -1;
     }
 
-    if (cks && crc32(buffer+1,n) != 0)
+    if (cks && crc32((char *)buffer+1,n) != 0)
     {
       fprintf(stderr,"crc error\n"); /* FIXME: ??? */
       continue;
@@ -1093,7 +1093,7 @@ static void f_parse_pmt(INT32 args)
           case 0x0a:
             if (buffer[index]==3 || buffer[index]==4) {
 	      push_text("lang");
-	      push_string(make_shared_binary_string(&buffer[i+2], 3)); cnt++;
+	      push_string(make_shared_binary_string((char *)&buffer[i+2], 3)); cnt++;
             }
             break;
           case 0x09:
@@ -1366,7 +1366,7 @@ static void f_stream_read(INT32 args) {
 
   dvb_stream_data *dvb_stream = DVBStream;
   int all = 1, ret, e, cnt, ix = 0;
-  char buf[MAX_DVB_READ_SIZE], *bufptr;
+  unsigned char buf[MAX_DVB_READ_SIZE], *bufptr;
 
   if(dvb_stream->fd < 0)
     Pike_error("Object destroyed!\n");
@@ -1664,7 +1664,7 @@ static void f_audio_mixer(INT32 args) {
 /*! @endmodule
  */
 
-static void init_dvb_data(struct object *obj) {
+static void init_dvb_data(struct object *UNUSED(obj)) {
 
   unsigned int i;
 
@@ -1674,7 +1674,7 @@ static void init_dvb_data(struct object *obj) {
 }
 
 static void exit_dvb_stream(struct object *obj);
-static void exit_dvb_data(struct object *obj) {
+static void exit_dvb_data(struct object *UNUSED(obj)) {
 
   dvb_stream_data *s;
 
@@ -1688,17 +1688,17 @@ static void exit_dvb_data(struct object *obj) {
   }
 }
 
-static void init_dvb_audio(struct object *obj) {
+static void init_dvb_audio(struct object *UNUSED(obj)) {
   DVBAudio->fd = -1;
   memset(&DVBAudio->low_errmsg, '\0', sizeof(DVBAudio->low_errmsg));
 }
 
-static void exit_dvb_audio(struct object *obj) {
+static void exit_dvb_audio(struct object *UNUSED(obj)) {
   if(DVBAudio->fd != -1)
     close(DVBAudio->fd);
 }
 
-static void init_dvb_stream(struct object *obj) {
+static void init_dvb_stream(struct object *UNUSED(obj)) {
 
   DVBStream->parent = NULL;
   DVBStream->next = NULL;
@@ -1711,7 +1711,7 @@ static void init_dvb_stream(struct object *obj) {
 }
 
 
-static void exit_dvb_stream(struct object *obj) {
+static void exit_dvb_stream(struct object *UNUSED(obj)) {
 
   struct ECMINFO *e;
   unsigned int i;
diff --git a/src/modules/_Image_JPEG/transupp.c b/src/modules/_Image_JPEG/transupp.c
index 0510eece643dff3bb54dadc71598b5cc614518fa..f0f8b83af4faf0eea98376acf9710cae9df58b32 100644
--- a/src/modules/_Image_JPEG/transupp.c
+++ b/src/modules/_Image_JPEG/transupp.c
@@ -1589,10 +1589,11 @@ jtransform_execute_transform (j_decompress_ptr srcinfo,
  */
 
 #ifndef TRANSFORMS_NOT_SUPPORTED
+
+#ifdef SAVE_MARKERS_SUPPORTED
 GLOBAL(void)
 jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
 {
-#ifdef SAVE_MARKERS_SUPPORTED
   int m;
 
   /* Save comments except under NONE option */
@@ -1604,8 +1605,11 @@ jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
     for (m = 0; m < 16; m++)
       jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
   }
-#endif /* SAVE_MARKERS_SUPPORTED */
 }
+#else
+GLOBAL(void)
+jcopy_markers_setup (j_decompress_ptr UNUSED(srcinfo), JCOPY_OPTION UNUSED(option)) {}
+#endif /* SAVE_MARKERS_SUPPORTED */
 
 /* Copy markers saved in the given source object to the destination object.
  * This should be called just after jpeg_start_compress() or
diff --git a/src/pike_embed.c b/src/pike_embed.c
index 1875a6a3c55f1973a782c895fab6af46b22ef1bf..f6dae9aad558ffeab0c029b94d195f7f8fe4bc6f 100644
--- a/src/pike_embed.c
+++ b/src/pike_embed.c
@@ -458,7 +458,7 @@ void gdb_break_on_pike_stack_record(long stack_size)
 static unsigned int samples[8200];
 long record;
 
-static void sample_stack(struct callback *cb,void *tmp,void *ignored)
+static void sample_stack(struct callback *cb,void *UNUSED(tmp),void *UNUSED(ignored))
 {
   long stack_size=( ((char *)&cb) - Pike_interpreter.stack_bottom) * STACK_DIRECTION;
   stack_size>>=10;
diff --git a/src/post_modules/CritBit/bignumtree.cmod b/src/post_modules/CritBit/bignumtree.cmod
index 1784671c18d2a69cfd4c5b5233388e91c8414faf..82e382b461de3666a9cafdec83fcdcb9a9400a4e 100644
--- a/src/post_modules/CritBit/bignumtree.cmod
+++ b/src/post_modules/CritBit/bignumtree.cmod
@@ -1,7 +1,8 @@
 /* vim:syntax=c
  */
+#ifdef PIKE_DEBUG
 #define DEBUG_CHECKS
-
+#endif
 #include "common.h"
 
 #include "critbit/bignum2svalue.h"
diff --git a/src/post_modules/CritBit/critbit/key_float.h b/src/post_modules/CritBit/critbit/key_float.h
index 4217b5a24d1ad5e21947ea3d175b1adac0126e9d..300c2ae4fc911f8f1184528e31c1f4371aa2fbb6 100644
--- a/src/post_modules/CritBit/critbit/key_float.h
+++ b/src/post_modules/CritBit/critbit/key_float.h
@@ -88,7 +88,7 @@ static inline FLOAT_TYPE cb_decode_float(cb_char s) {
 static inline cb_size cb_prefix_count_float(const cb_string s1,
 					    const cb_string s2,
 					    const cb_size len,
-					    const cb_size start) {
+                                            const cb_size UNUSED(start)) {
     cb_size ret;
 
     if (s1 == s2) return len;
diff --git a/src/post_modules/CritBit/critbit/key_int.h b/src/post_modules/CritBit/critbit/key_int.h
index efd6950cc32d9cf7f100884e9934b8f8c050eb0e..6317385c266670661bbc110240c88e17b32c1e47 100644
--- a/src/post_modules/CritBit/critbit/key_int.h
+++ b/src/post_modules/CritBit/critbit/key_int.h
@@ -56,7 +56,7 @@ typedef unsigned INT64 CB_NAME(char);
 static inline cb_size cb_prefix_count_integer(const cb_string s1,
 					      const cb_string s2,
 					      const cb_size len,
-					      const cb_size start) {
+                                              const cb_size UNUSED(start)) {
     cb_size ret;
 
     if (s1 == s2) return len;
diff --git a/src/post_modules/CritBit/tree_high.c b/src/post_modules/CritBit/tree_high.c
index 7d3e11172a4611817d7299b70873cdd638a4e1f6..9c21e1b0c221c8b070ac5037e3c8f2c019403d9f 100644
--- a/src/post_modules/CritBit/tree_high.c
+++ b/src/post_modules/CritBit/tree_high.c
@@ -142,7 +142,9 @@ static inline int cb_print_path(struct string_builder *buf, cb_node_t node,
     return 0;
 }
 
-static inline void cb_check(cb_node_t node, cb_node_t last, char *issue) {
+static inline void cb_check(cb_node_t node,
+                            cb_node_t DEBUGUSED(last),
+                            char *issue) {
 #ifdef DEBUG_CHECKS
     if (CB_LT(node->key.len, last->key.len)) {
 	struct string_builder buf;
@@ -186,7 +188,7 @@ static inline int cb_rec_check_parents(cb_node_t node) {
 
 static inline void cb_aggregate_values(cb_node_t node,
 				       struct array * a, size_t start,
-				       size_t len) {
+				       size_t UNUSED(len)) {
     if (CB_HAS_VALUE(node))
 	CB_GET_VALUE(node, ITEM(a)+start++);
     WALK_FORWARD(node, {
diff --git a/src/post_modules/CritBit/tree_low.c b/src/post_modules/CritBit/tree_low.c
index 060b846ccfd95080f3b480b51a53f19ec03f3351..3755961519441da3a7dc8cf52a1615f9b42912a6 100644
--- a/src/post_modules/CritBit/tree_low.c
+++ b/src/post_modules/CritBit/tree_low.c
@@ -144,7 +144,7 @@ CB_STATIC CB_INLINE void cb_get_range(const struct cb_tree * src,
     }
 }
 
-static inline cb_node_t cb_node_from_string(const struct cb_tree * tree, 
+static inline cb_node_t cb_node_from_string(const struct cb_tree * UNUSED(tree),
 					    const cb_key s,
 					    const cb_value * val) {
     cb_node_t node = node_init();
@@ -160,7 +160,7 @@ static inline cb_node_t cb_node_from_string(const struct cb_tree * tree,
     return node;
 }
 
-static inline cb_node_t cb_clone_node(const struct cb_tree * tree,
+static inline cb_node_t cb_clone_node(const struct cb_tree * UNUSED(tree),
 				      const cb_node_t node) {
     cb_node_t nnode = CB_NODE_ALLOC();
 
@@ -212,7 +212,8 @@ static void cb_free_node(const struct cb_tree * tree, cb_node_t node) {
     cb_zap_node(tree, node);
 }
 
-static inline void cb_zap_node(const struct cb_tree * tree, cb_node_t node) {
+static inline void cb_zap_node(const struct cb_tree * UNUSED(tree),
+                               cb_node_t node) {
     CB_FREE_KEY(node->key);
     CB_RM_VALUE(node);
     CB_NODE_FREE(node);
diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod
index efb7b4fddb5db21bc13c4b94358f99c296458859..153a6a2e8fe2d02048cf32d3b7d456d17d10d3c3 100644
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -659,7 +659,7 @@ pike_camellia_set_encrypt_key(void *ctx,
 static void
 pike_camellia_set_decrypt_key(void *ctx,
 			      ptrdiff_t length, const char *key,
-			      int force)
+                              int UNUSED(force))
 {
   if (length < CAMELLIA_MIN_KEY_SIZE || length > CAMELLIA_MAX_KEY_SIZE)
     Pike_error("CAMELLIA: Bad keysize for CAMELLIA.\n");