diff options
-rw-r--r-- | byterun/extern.c | 36 | ||||
-rw-r--r-- | byterun/fail.c | 3 | ||||
-rw-r--r-- | byterun/intern.c | 6 | ||||
-rw-r--r-- | byterun/major_gc.c | 1 | ||||
-rw-r--r-- | byterun/memory.h | 21 | ||||
-rw-r--r-- | byterun/misc.h | 8 | ||||
-rw-r--r-- | byterun/parsing.c | 1 | ||||
-rw-r--r-- | byterun/str.c | 2 | ||||
-rw-r--r-- | byterun/sys.c | 1 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | otherlibs/graph/color.c | 2 | ||||
-rw-r--r-- | otherlibs/labltk/support/cltkEval.c | 1 | ||||
-rw-r--r-- | otherlibs/labltk/support/cltkImg.c | 1 | ||||
-rw-r--r-- | otherlibs/labltk/tkanim/tkAnimGIF.c | 1 | ||||
-rw-r--r-- | otherlibs/str/strstubs.c | 2 | ||||
-rw-r--r-- | stdlib/sys.ml | 2 |
16 files changed, 50 insertions, 40 deletions
diff --git a/byterun/extern.c b/byterun/extern.c index 35c796933..8142f79e4 100644 --- a/byterun/extern.c +++ b/byterun/extern.c @@ -565,13 +565,15 @@ CAMLexport void caml_serialize_block_1(void * data, long len) CAMLexport void caml_serialize_block_2(void * data, long len) { - unsigned char * p; - char * q; if (extern_ptr + 2 * len > extern_limit) resize_extern_block(2 * len); #ifndef ARCH_BIG_ENDIAN - for (p = data, q = extern_ptr; len > 0; len--, p += 2, q += 2) - Reverse_16(q, p); - extern_ptr = q; + { + unsigned char * p; + char * q; + for (p = data, q = extern_ptr; len > 0; len--, p += 2, q += 2) + Reverse_16(q, p); + extern_ptr = q; + } #else memmove(extern_ptr, data, len * 2); extern_ptr += len * 2; @@ -580,13 +582,15 @@ CAMLexport void caml_serialize_block_2(void * data, long len) CAMLexport void caml_serialize_block_4(void * data, long len) { - unsigned char * p; - char * q; if (extern_ptr + 4 * len > extern_limit) resize_extern_block(4 * len); #ifndef ARCH_BIG_ENDIAN - for (p = data, q = extern_ptr; len > 0; len--, p += 4, q += 4) - Reverse_32(q, p); - extern_ptr = q; + { + unsigned char * p; + char * q; + for (p = data, q = extern_ptr; len > 0; len--, p += 4, q += 4) + Reverse_32(q, p); + extern_ptr = q; + } #else memmove(extern_ptr, data, len * 4); extern_ptr += len * 4; @@ -595,13 +599,15 @@ CAMLexport void caml_serialize_block_4(void * data, long len) CAMLexport void caml_serialize_block_8(void * data, long len) { - unsigned char * p; - char * q; if (extern_ptr + 8 * len > extern_limit) resize_extern_block(8 * len); #ifndef ARCH_BIG_ENDIAN - for (p = data, q = extern_ptr; len > 0; len--, p += 8, q += 8) - Reverse_64(q, p); - extern_ptr = q; + { + unsigned char * p; + char * q; + for (p = data, q = extern_ptr; len > 0; len--, p += 8, q += 8) + Reverse_64(q, p); + extern_ptr = q; + } #else memmove(extern_ptr, data, len * 8); extern_ptr += len * 8; diff --git a/byterun/fail.c b/byterun/fail.c index d785d98f3..64d766fe4 100644 --- a/byterun/fail.c +++ b/byterun/fail.c @@ -49,6 +49,7 @@ CAMLexport void caml_raise_constant(value tag) bucket = caml_alloc_small (1, 0); Field(bucket, 0) = tag; caml_raise(bucket); + CAMLnoreturn; } CAMLexport void caml_raise_with_arg(value tag, value arg) @@ -60,6 +61,7 @@ CAMLexport void caml_raise_with_arg(value tag, value arg) Field(bucket, 0) = tag; Field(bucket, 1) = arg; caml_raise(bucket); + CAMLnoreturn; } CAMLexport void caml_raise_with_string(value tag, char *msg) @@ -69,6 +71,7 @@ CAMLexport void caml_raise_with_string(value tag, char *msg) vmsg = caml_copy_string(msg); caml_raise_with_arg(tag, vmsg); + CAMLnoreturn; } CAMLexport void caml_failwith (char *msg) diff --git a/byterun/intern.c b/byterun/intern.c index 34b22340a..00872d6d5 100644 --- a/byterun/intern.c +++ b/byterun/intern.c @@ -651,8 +651,8 @@ CAMLexport void caml_deserialize_block_1(void * data, long len) CAMLexport void caml_deserialize_block_2(void * data, long len) { - unsigned char * p, * q; #ifndef ARCH_BIG_ENDIAN + unsigned char * p, * q; for (p = intern_src, q = data; len > 0; len--, p += 2, q += 2) Reverse_16(q, p); intern_src = p; @@ -664,8 +664,8 @@ CAMLexport void caml_deserialize_block_2(void * data, long len) CAMLexport void caml_deserialize_block_4(void * data, long len) { - unsigned char * p, * q; #ifndef ARCH_BIG_ENDIAN + unsigned char * p, * q; for (p = intern_src, q = data; len > 0; len--, p += 4, q += 4) Reverse_32(q, p); intern_src = p; @@ -677,8 +677,8 @@ CAMLexport void caml_deserialize_block_4(void * data, long len) CAMLexport void caml_deserialize_block_8(void * data, long len) { - unsigned char * p, * q; #ifndef ARCH_BIG_ENDIAN + unsigned char * p, * q; for (p = intern_src, q = data; len > 0; len--, p += 8, q += 8) Reverse_64(q, p); intern_src = p; diff --git a/byterun/major_gc.c b/byterun/major_gc.c index d39cd2f20..255b7766c 100644 --- a/byterun/major_gc.c +++ b/byterun/major_gc.c @@ -417,7 +417,6 @@ asize_t caml_round_heap_chunk_size (asize_t request) void caml_init_major_heap (asize_t heap_size) { asize_t i; - void *block; asize_t page_table_size; page_table_entry *page_table_block; diff --git a/byterun/memory.h b/byterun/memory.h index 4be908b8c..172af5e8c 100644 --- a/byterun/memory.h +++ b/byterun/memory.h @@ -168,9 +168,15 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ CAMLxparamN (x, (size)) +#if defined (__GNUC__) + #define CAMLunused __attribute__ ((unused)) +#else + #define CAMLunused +#endif + #define CAMLxparam1(x) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = 1), \ @@ -180,7 +186,7 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ #define CAMLxparam2(x, y) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = 1), \ @@ -191,7 +197,7 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ #define CAMLxparam3(x, y, z) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = 1), \ @@ -203,7 +209,7 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ #define CAMLxparam4(x, y, z, t) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = 1), \ @@ -216,7 +222,7 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ #define CAMLxparam5(x, y, z, t, u) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = 1), \ @@ -230,7 +236,7 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ #define CAMLxparamN(x, size) \ struct caml__roots_block caml__roots_##x; \ - int caml__dummy_##x = ( \ + CAMLunused int caml__dummy_##x = ( \ (caml__roots_##x.next = caml_local_roots), \ (caml_local_roots = &caml__roots_##x), \ (caml__roots_##x.nitems = (size)), \ @@ -273,6 +279,9 @@ CAMLextern struct caml__roots_block *caml_local_roots; /* defined in roots.c */ return (result); \ }while(0) +#define CAMLnoreturn ((void) caml__frame) + + /* convenience macro */ #define Store_field(block, offset, val) do{ \ mlsize_t caml__temp_offset = (offset); \ diff --git a/byterun/misc.h b/byterun/misc.h index e36c1586a..bda864fc4 100644 --- a/byterun/misc.h +++ b/byterun/misc.h @@ -41,10 +41,10 @@ typedef char * addr; /* </private> */ #ifdef __GNUC__ -/* Works only in GCC 2.5 and later */ -#define Noreturn __attribute ((noreturn)) + /* Works only in GCC 2.5 and later */ + #define Noreturn __attribute__ ((noreturn)) #else -#define Noreturn + #define Noreturn #endif /* Export control (to mark primitives and to handle Windows DLL) */ @@ -71,7 +71,7 @@ typedef char * addr; #define CAMLassert(x) ((x) ? 0 : caml_failed_assert ( #x , __FILE__, __LINE__)) CAMLextern int caml_failed_assert (char *, char *, int); #else -#define CAMLassert(x) 0 +#define CAMLassert(x) ((void) 0) #endif CAMLextern void caml_fatal_error (char *msg) Noreturn; diff --git a/byterun/parsing.c b/byterun/parsing.c index 68e687ffd..2d90fa552 100644 --- a/byterun/parsing.c +++ b/byterun/parsing.c @@ -115,7 +115,6 @@ static char * token_name(char * names, int number) static void print_token(struct parser_tables *tables, int state, value tok) { - mlsize_t i; value v; if (Is_long(tok)) { diff --git a/byterun/str.c b/byterun/str.c index 08bbf839e..8151fa37c 100644 --- a/byterun/str.c +++ b/byterun/str.c @@ -83,7 +83,7 @@ CAMLprim value caml_string_notequal(value s1, value s2) CAMLprim value caml_string_compare(value s1, value s2) { - mlsize_t len1, len2, len; + mlsize_t len1, len2; int res; len1 = caml_string_length(s1); diff --git a/byterun/sys.c b/byterun/sys.c index f04d676f5..f76a55643 100644 --- a/byterun/sys.c +++ b/byterun/sys.c @@ -106,6 +106,7 @@ CAMLexport void caml_sys_error(value arg) } caml_raise_sys_error(str); } + CAMLnoreturn; } CAMLprim value caml_sys_exit(value retcode) @@ -39,7 +39,7 @@ verbose=no withcurses=yes withsharedlibs=yes binutils_dir='' -gcc_warnings="-Wall -Wno-unused" +gcc_warnings="-Wall" # Try to turn internationalization off, can cause config.guess to malfunction! unset LANG diff --git a/otherlibs/graph/color.c b/otherlibs/graph/color.c index cf3380a77..57a9dcd2f 100644 --- a/otherlibs/graph/color.c +++ b/otherlibs/graph/color.c @@ -74,7 +74,6 @@ void caml_gr_init_direct_rgb_to_pixel(void) visual = DefaultVisual(caml_gr_display,caml_gr_screen); if ( visual->class == TrueColor || visual->class == DirectColor ){ - int lsl, lsr; caml_gr_red_mask = visual->red_mask; caml_gr_green_mask = visual->green_mask; @@ -150,7 +149,6 @@ unsigned long caml_gr_pixel_rgb(int rgb) unsigned int r, g, b; int h, i; XColor color; - unsigned short tmp; r = (rgb >> 16) & 0xFF; g = (rgb >> 8) & 0xFF; diff --git a/otherlibs/labltk/support/cltkEval.c b/otherlibs/labltk/support/cltkEval.c index b31bc1adf..e7fbed879 100644 --- a/otherlibs/labltk/support/cltkEval.c +++ b/otherlibs/labltk/support/cltkEval.c @@ -199,7 +199,6 @@ CAMLprim value camltk_tcl_direct_eval(value v) */ if (info.proc == NULL) { Tcl_DString buf; - char *string; Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, argv[0], -1); for (i=1; i<size; i++) { diff --git a/otherlibs/labltk/support/cltkImg.c b/otherlibs/labltk/support/cltkImg.c index 1debe822e..445338e08 100644 --- a/otherlibs/labltk/support/cltkImg.c +++ b/otherlibs/labltk/support/cltkImg.c @@ -81,7 +81,6 @@ camltk_setimgdata_native (value imgname, value pixmap, value x, value y, { Tk_PhotoHandle ph; Tk_PhotoImageBlock pib; - int code; #if (TK_MAJOR_VERSION < 8) if (NULL == (ph = Tk_FindPhoto(String_val(imgname)))) diff --git a/otherlibs/labltk/tkanim/tkAnimGIF.c b/otherlibs/labltk/tkanim/tkAnimGIF.c index 1beb81439..d8eb11ebc 100644 --- a/otherlibs/labltk/tkanim/tkAnimGIF.c +++ b/otherlibs/labltk/tkanim/tkAnimGIF.c @@ -102,7 +102,6 @@ FileReadGIF(interp, f, fileName, formatString) char newresbuf[640]; char *imageName; char *resultptr; - int prevpos; int loop = -1; if((winPtr = Tk_MainWindow(interp)) == NULL){ diff --git a/otherlibs/str/strstubs.c b/otherlibs/str/strstubs.c index ae86c91b6..a399c24eb 100644 --- a/otherlibs/str/strstubs.c +++ b/otherlibs/str/strstubs.c @@ -401,7 +401,6 @@ CAMLprim value re_search_forward(value re, value str, value startpos) unsigned char * txt = &Byte_u(str, Long_val(startpos)); unsigned char * endtxt = &Byte_u(str, string_length(str)); unsigned char * startchars; - unsigned char c; if (txt < starttxt || txt > endtxt) invalid_argument("Str.search_forward"); @@ -431,7 +430,6 @@ CAMLprim value re_search_backward(value re, value str, value startpos) unsigned char * txt = &Byte_u(str, Long_val(startpos)); unsigned char * endtxt = &Byte_u(str, string_length(str)); unsigned char * startchars; - unsigned char c; if (txt < starttxt || txt > endtxt) invalid_argument("Str.search_backward"); diff --git a/stdlib/sys.ml b/stdlib/sys.ml index 8c82d0ad7..3d7e7e256 100644 --- a/stdlib/sys.ml +++ b/stdlib/sys.ml @@ -78,4 +78,4 @@ let catch_break on = (* OCaml version string, must be in the format described in sys.mli. *) -let ocaml_version = "3.07+17 (2004-04-22)";; +let ocaml_version = "3.07+18 (2004-05-17)";; |