diff options
30 files changed, 265 insertions, 198 deletions
@@ -52,11 +52,18 @@ Bug fixes: - PR#4766: incorrect simplification of some type abbreviations. - PR#4768: printf: %F does not respect width and precision specifications - PR#4769: Format.bprintf fails to flush -- PR#4775: compiler crash on crazy types (temporary fix) +- PR#4775: fatal error Ctype.Unify during module type-checking (temporary fix) - PR#4776: bad interaction between exceptions and classes - PR#4780: labltk build problem under Windows. - PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix error. - PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms. +- PR#4796: ocamlyacc: missing NUL termination of string +- PR#4804: bug in Big_int.int64_of_big_int on 32-bit platforms. +- PR#4805: improving compatibility with the clang C compiler +- PR#4809: issue with Unix.create_process under Win32 +- PR#4814: ocamlbrowser: crash when editing comments +- PR#4816: module abbreviations remove 'private' type restrictions +- PR#4817: Object type gives error "Unbound type parameter .." - Module Parsing: improved computation of locations when an ocamlyacc rule starts with an empty nonterminal - Type-checker: fixed wrong variance computation for private types @@ -1,4 +1,4 @@ -3.12.0+dev3 (2009-05-20) +3.12.0+dev4 (2009-07-20) # The version string is the first line of this file. # It must be in the format described in stdlib/sys.mli diff --git a/boot/.cvsignore b/boot/.cvsignore index b9c6f8584..a0a2356c9 100644 --- a/boot/.cvsignore +++ b/boot/.cvsignore @@ -3,3 +3,4 @@ ocamlrun ocamlyacc camlheader myocamlbuild +myocamlbuild.native diff --git a/boot/ocamlc b/boot/ocamlc Binary files differindex 384b60060..808d5b87f 100755 --- a/boot/ocamlc +++ b/boot/ocamlc diff --git a/boot/ocamldep b/boot/ocamldep Binary files differindex b5aa79394..106160ccc 100755 --- a/boot/ocamldep +++ b/boot/ocamldep diff --git a/boot/ocamllex b/boot/ocamllex Binary files differindex 8e7af0db7..15437fdb0 100755 --- a/boot/ocamllex +++ b/boot/ocamllex diff --git a/build/fastworld.sh b/build/fastworld.sh index cdf9ba4ac..5c08e1aae 100755 --- a/build/fastworld.sh +++ b/build/fastworld.sh @@ -25,7 +25,7 @@ fi ./mkconfig.sh ./mkmyocamlbuild_config.sh . ../config/config.sh -if [ "x$EXE" = "x.exe" ]; then +if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then ./boot-c-parts-windows.sh else ./boot-c-parts.sh diff --git a/build/install.sh b/build/install.sh index 06feb41ba..4c38740c5 100755 --- a/build/install.sh +++ b/build/install.sh @@ -116,6 +116,7 @@ mkdir -p $MANDIR/man$MANEXT echo "Installing core libraries..." installlibdir byterun/libcamlrun.$A asmrun/libasmrun.$A asmrun/libasmrunp.$A \ $LIBDIR +installdir byterun/libcamlrun_shared$EXT_DLL $LIBDIR PUBLIC_INCLUDES="\ alloc.h callback.h config.h custom.h fail.h intext.h \ @@ -161,96 +162,96 @@ installdir \ stdlib/stdlib.cmxa stdlib/stdlib.p.cmxa \ stdlib/camlheader \ stdlib/camlheader_ur \ - stdlib/std_exit.cm[io] \ - stdlib/arg.cmi stdlib/arg.mli \ - stdlib/array.cmi stdlib/array.mli \ - stdlib/arrayLabels.cmi stdlib/arrayLabels.mli \ - stdlib/buffer.cmi stdlib/buffer.mli \ - stdlib/callback.cmi stdlib/callback.mli \ - stdlib/camlinternalLazy.cmi stdlib/camlinternalLazy.mli \ - stdlib/camlinternalMod.cmi stdlib/camlinternalMod.mli \ - stdlib/camlinternalOO.cmi stdlib/camlinternalOO.mli \ - stdlib/char.cmi stdlib/char.mli \ - stdlib/complex.cmi stdlib/complex.mli \ - stdlib/digest.cmi stdlib/digest.mli \ - stdlib/filename.cmi stdlib/filename.mli \ - stdlib/format.cmi stdlib/format.mli \ - stdlib/gc.cmi stdlib/gc.mli \ - stdlib/genlex.cmi stdlib/genlex.mli \ - stdlib/hashtbl.cmi stdlib/hashtbl.mli \ - stdlib/int32.cmi stdlib/int32.mli \ - stdlib/int64.cmi stdlib/int64.mli \ - stdlib/lazy.cmi stdlib/lazy.mli \ - stdlib/lexing.cmi stdlib/lexing.mli \ - stdlib/list.cmi stdlib/list.mli \ - stdlib/listLabels.cmi stdlib/listLabels.mli \ - stdlib/map.cmi stdlib/map.mli \ - stdlib/marshal.cmi stdlib/marshal.mli \ - stdlib/moreLabels.cmi stdlib/moreLabels.mli \ - stdlib/nativeint.cmi stdlib/nativeint.mli \ - stdlib/obj.cmi stdlib/obj.mli \ - stdlib/oo.cmi stdlib/oo.mli \ - stdlib/parsing.cmi stdlib/parsing.mli \ - stdlib/pervasives.cmi stdlib/pervasives.mli \ - stdlib/printexc.cmi stdlib/printexc.mli \ - stdlib/printf.cmi stdlib/printf.mli \ - stdlib/queue.cmi stdlib/queue.mli \ - stdlib/random.cmi stdlib/random.mli \ - stdlib/scanf.cmi stdlib/scanf.mli \ - stdlib/sort.cmi stdlib/sort.mli \ - stdlib/stack.cmi stdlib/stack.mli \ - stdlib/stdLabels.cmi stdlib/stdLabels.mli \ - stdlib/stream.cmi stdlib/stream.mli \ - stdlib/string.cmi stdlib/string.mli \ - stdlib/stringLabels.cmi stdlib/stringLabels.mli \ - stdlib/sys.cmi stdlib/sys.mli \ - stdlib/weak.cmi stdlib/weak.mli \ - stdlib/$set.cmi stdlib/$set.mli \ - stdlib/arg.cmx stdlib/arg.p.cmx stdlib/arg.$O stdlib/arg.p.$O \ - stdlib/array.cmx stdlib/array.p.cmx stdlib/array.$O stdlib/array.p.$O \ - stdlib/arrayLabels.cmx stdlib/arrayLabels.p.cmx stdlib/arrayLabels.$O stdlib/arrayLabels.p.$O \ - stdlib/buffer.cmx stdlib/buffer.p.cmx stdlib/buffer.$O stdlib/buffer.p.$O \ - stdlib/callback.cmx stdlib/callback.p.cmx stdlib/callback.$O stdlib/callback.p.$O \ - stdlib/camlinternalLazy.cmx stdlib/camlinternalLazy.p.cmx stdlib/camlinternalLazy.$O stdlib/camlinternalLazy.p.$O \ - stdlib/camlinternalMod.cmx stdlib/camlinternalMod.p.cmx stdlib/camlinternalMod.$O stdlib/camlinternalMod.p.$O \ - stdlib/camlinternalOO.cmx stdlib/camlinternalOO.p.cmx stdlib/camlinternalOO.$O stdlib/camlinternalOO.p.$O \ - stdlib/char.cmx stdlib/char.p.cmx stdlib/char.$O stdlib/char.p.$O \ - stdlib/complex.cmx stdlib/complex.p.cmx stdlib/complex.$O stdlib/complex.p.$O \ - stdlib/digest.cmx stdlib/digest.p.cmx stdlib/digest.$O stdlib/digest.p.$O \ - stdlib/filename.cmx stdlib/filename.p.cmx stdlib/filename.$O stdlib/filename.p.$O \ - stdlib/format.cmx stdlib/format.p.cmx stdlib/format.$O stdlib/format.p.$O \ - stdlib/gc.cmx stdlib/gc.p.cmx stdlib/gc.$O stdlib/gc.p.$O \ - stdlib/genlex.cmx stdlib/genlex.p.cmx stdlib/genlex.$O stdlib/genlex.p.$O \ - stdlib/hashtbl.cmx stdlib/hashtbl.p.cmx stdlib/hashtbl.$O stdlib/hashtbl.p.$O \ - stdlib/int32.cmx stdlib/int32.p.cmx stdlib/int32.$O stdlib/int32.p.$O \ - stdlib/int64.cmx stdlib/int64.p.cmx stdlib/int64.$O stdlib/int64.p.$O \ - stdlib/lazy.cmx stdlib/lazy.p.cmx stdlib/lazy.$O stdlib/lazy.p.$O \ - stdlib/lexing.cmx stdlib/lexing.p.cmx stdlib/lexing.$O stdlib/lexing.p.$O \ - stdlib/list.cmx stdlib/list.p.cmx stdlib/list.$O stdlib/list.p.$O \ - stdlib/listLabels.cmx stdlib/listLabels.p.cmx stdlib/listLabels.$O stdlib/listLabels.p.$O \ - stdlib/map.cmx stdlib/map.p.cmx stdlib/map.$O stdlib/map.p.$O \ - stdlib/marshal.cmx stdlib/marshal.p.cmx stdlib/marshal.$O stdlib/marshal.p.$O \ - stdlib/moreLabels.cmx stdlib/moreLabels.p.cmx stdlib/moreLabels.$O stdlib/moreLabels.p.$O \ - stdlib/nativeint.cmx stdlib/nativeint.p.cmx stdlib/nativeint.$O stdlib/nativeint.p.$O \ - stdlib/obj.cmx stdlib/obj.p.cmx stdlib/obj.$O stdlib/obj.p.$O \ - stdlib/oo.cmx stdlib/oo.p.cmx stdlib/oo.$O stdlib/oo.p.$O \ - stdlib/parsing.cmx stdlib/parsing.p.cmx stdlib/parsing.$O stdlib/parsing.p.$O \ - stdlib/pervasives.cmx stdlib/pervasives.p.cmx stdlib/pervasives.$O stdlib/pervasives.p.$O \ - stdlib/printexc.cmx stdlib/printexc.p.cmx stdlib/printexc.$O stdlib/printexc.p.$O \ - stdlib/printf.cmx stdlib/printf.p.cmx stdlib/printf.$O stdlib/printf.p.$O \ - stdlib/queue.cmx stdlib/queue.p.cmx stdlib/queue.$O stdlib/queue.p.$O \ - stdlib/random.cmx stdlib/random.p.cmx stdlib/random.$O stdlib/random.p.$O \ - stdlib/scanf.cmx stdlib/scanf.p.cmx stdlib/scanf.$O stdlib/scanf.p.$O \ - stdlib/sort.cmx stdlib/sort.p.cmx stdlib/sort.$O stdlib/sort.p.$O \ - stdlib/stack.cmx stdlib/stack.p.cmx stdlib/stack.$O stdlib/stack.p.$O \ - stdlib/stdLabels.cmx stdlib/stdLabels.p.cmx stdlib/stdLabels.$O stdlib/stdLabels.p.$O \ + stdlib/std_exit.cm[io] stdlib/std_exit.ml \ + stdlib/arg.cmi stdlib/arg.ml stdlib/arg.mli \ + stdlib/array.cmi stdlib/array.ml stdlib/array.mli \ + stdlib/arrayLabels.cmi stdlib/arrayLabels.ml stdlib/arrayLabels.mli \ + stdlib/buffer.cmi stdlib/buffer.ml stdlib/buffer.mli \ + stdlib/callback.cmi stdlib/callback.ml stdlib/callback.mli \ + stdlib/camlinternalLazy.cmi stdlib/camlinternalLazy.ml stdlib/camlinternalLazy.mli \ + stdlib/camlinternalMod.cmi stdlib/camlinternalMod.ml stdlib/camlinternalMod.mli \ + stdlib/camlinternalOO.cmi stdlib/camlinternalOO.ml stdlib/camlinternalOO.mli \ + stdlib/char.cmi stdlib/char.ml stdlib/char.mli \ + stdlib/complex.cmi stdlib/complex.ml stdlib/complex.mli \ + stdlib/digest.cmi stdlib/digest.ml stdlib/digest.mli \ + stdlib/filename.cmi stdlib/filename.ml stdlib/filename.mli \ + stdlib/format.cmi stdlib/format.ml stdlib/format.mli \ + stdlib/gc.cmi stdlib/gc.ml stdlib/gc.mli \ + stdlib/genlex.cmi stdlib/genlex.ml stdlib/genlex.mli \ + stdlib/hashtbl.cmi stdlib/hashtbl.ml stdlib/hashtbl.mli \ + stdlib/int32.cmi stdlib/int32.ml stdlib/int32.mli \ + stdlib/int64.cmi stdlib/int64.ml stdlib/int64.mli \ + stdlib/lazy.cmi stdlib/lazy.ml stdlib/lazy.mli \ + stdlib/lexing.cmi stdlib/lexing.ml stdlib/lexing.mli \ + stdlib/list.cmi stdlib/list.ml stdlib/list.mli \ + stdlib/listLabels.cmi stdlib/listLabels.ml stdlib/listLabels.mli \ + stdlib/map.cmi stdlib/map.ml stdlib/map.mli \ + stdlib/marshal.cmi stdlib/marshal.ml stdlib/marshal.mli \ + stdlib/moreLabels.cmi stdlib/moreLabels.ml stdlib/moreLabels.mli \ + stdlib/nativeint.cmi stdlib/nativeint.ml stdlib/nativeint.mli \ + stdlib/obj.cmi stdlib/obj.ml stdlib/obj.mli \ + stdlib/oo.cmi stdlib/oo.ml stdlib/oo.mli \ + stdlib/parsing.cmi stdlib/parsing.ml stdlib/parsing.mli \ + stdlib/pervasives.cmi stdlib/pervasives.ml stdlib/pervasives.mli \ + stdlib/printexc.cmi stdlib/printexc.ml stdlib/printexc.mli \ + stdlib/printf.cmi stdlib/printf.ml stdlib/printf.mli \ + stdlib/queue.cmi stdlib/queue.ml stdlib/queue.mli \ + stdlib/random.cmi stdlib/random.ml stdlib/random.mli \ + stdlib/scanf.cmi stdlib/scanf.ml stdlib/scanf.mli \ + stdlib/sort.cmi stdlib/sort.ml stdlib/sort.mli \ + stdlib/stack.cmi stdlib/stack.ml stdlib/stack.mli \ + stdlib/stdLabels.cmi stdlib/stdLabels.ml stdlib/stdLabels.mli \ + stdlib/stream.cmi stdlib/stream.ml stdlib/stream.mli \ + stdlib/string.cmi stdlib/string.ml stdlib/string.mli \ + stdlib/stringLabels.cmi stdlib/stringLabels.ml stdlib/stringLabels.mli \ + stdlib/sys.cmi stdlib/sys.ml stdlib/sys.mli \ + stdlib/weak.cmi stdlib/weak.ml stdlib/weak.mli \ + stdlib/$set.cmi stdlib/$set.ml stdlib/$set.mli \ + stdlib/arg.cmx stdlib/arg.p.cmx \ + stdlib/array.cmx stdlib/array.p.cmx \ + stdlib/arrayLabels.cmx stdlib/arrayLabels.p.cmx \ + stdlib/buffer.cmx stdlib/buffer.p.cmx \ + stdlib/callback.cmx stdlib/callback.p.cmx \ + stdlib/camlinternalLazy.cmx stdlib/camlinternalLazy.p.cmx \ + stdlib/camlinternalMod.cmx stdlib/camlinternalMod.p.cmx \ + stdlib/camlinternalOO.cmx stdlib/camlinternalOO.p.cmx \ + stdlib/char.cmx stdlib/char.p.cmx \ + stdlib/complex.cmx stdlib/complex.p.cmx \ + stdlib/digest.cmx stdlib/digest.p.cmx \ + stdlib/filename.cmx stdlib/filename.p.cmx \ + stdlib/format.cmx stdlib/format.p.cmx \ + stdlib/gc.cmx stdlib/gc.p.cmx \ + stdlib/genlex.cmx stdlib/genlex.p.cmx \ + stdlib/hashtbl.cmx stdlib/hashtbl.p.cmx \ + stdlib/int32.cmx stdlib/int32.p.cmx \ + stdlib/int64.cmx stdlib/int64.p.cmx \ + stdlib/lazy.cmx stdlib/lazy.p.cmx \ + stdlib/lexing.cmx stdlib/lexing.p.cmx \ + stdlib/list.cmx stdlib/list.p.cmx \ + stdlib/listLabels.cmx stdlib/listLabels.p.cmx \ + stdlib/map.cmx stdlib/map.p.cmx \ + stdlib/marshal.cmx stdlib/marshal.p.cmx \ + stdlib/moreLabels.cmx stdlib/moreLabels.p.cmx \ + stdlib/nativeint.cmx stdlib/nativeint.p.cmx \ + stdlib/obj.cmx stdlib/obj.p.cmx \ + stdlib/oo.cmx stdlib/oo.p.cmx \ + stdlib/parsing.cmx stdlib/parsing.p.cmx \ + stdlib/pervasives.cmx stdlib/pervasives.p.cmx \ + stdlib/printexc.cmx stdlib/printexc.p.cmx \ + stdlib/printf.cmx stdlib/printf.p.cmx \ + stdlib/queue.cmx stdlib/queue.p.cmx \ + stdlib/random.cmx stdlib/random.p.cmx \ + stdlib/scanf.cmx stdlib/scanf.p.cmx \ + stdlib/sort.cmx stdlib/sort.p.cmx \ + stdlib/stack.cmx stdlib/stack.p.cmx \ + stdlib/stdLabels.cmx stdlib/stdLabels.p.cmx \ stdlib/std_exit.cmx stdlib/std_exit.p.cmx stdlib/std_exit.$O stdlib/std_exit.p.$O \ - stdlib/stream.cmx stdlib/stream.p.cmx stdlib/stream.$O stdlib/stream.p.$O \ - stdlib/string.cmx stdlib/string.p.cmx stdlib/string.$O stdlib/string.p.$O \ - stdlib/stringLabels.cmx stdlib/stringLabels.p.cmx stdlib/stringLabels.$O stdlib/stringLabels.p.$O \ - stdlib/sys.cmx stdlib/sys.p.cmx stdlib/sys.$O stdlib/sys.p.$O \ - stdlib/weak.cmx stdlib/weak.p.cmx stdlib/weak.$O stdlib/weak.p.$O \ - stdlib/$set.cmx stdlib/$set.p.cmx stdlib/$set.$O stdlib/$set.p.$O \ + stdlib/stream.cmx stdlib/stream.p.cmx \ + stdlib/string.cmx stdlib/string.p.cmx \ + stdlib/stringLabels.cmx stdlib/stringLabels.p.cmx \ + stdlib/sys.cmx stdlib/sys.p.cmx \ + stdlib/weak.cmx stdlib/weak.p.cmx \ + stdlib/$set.cmx stdlib/$set.p.cmx \ $LIBDIR installlibdir \ @@ -274,7 +275,6 @@ installbin tools/addlabels.byte $LIBDIR/addlabels installbin tools/scrapelabels.byte $LIBDIR/scrapelabels installbin otherlibs/dynlink/extract_crc.byte $LIBDIR/extract_crc installbin otherlibs/labltk/lib/labltk$EXE $BINDIR/labltk$EXE -installbin otherlibs/labltk/compiler/tkcompiler$EXE $BINDIR/tkcompiler$EXE installbin otherlibs/labltk/browser/ocamlbrowser$EXE $BINDIR/ocamlbrowser$EXE installbin otherlibs/labltk/compiler/pp$EXE $LIBDIR/labltk/pp$EXE installbin otherlibs/labltk/lib/labltktop$EXE $LIBDIR/labltk/labltktop$EXE @@ -290,6 +290,7 @@ installdir \ otherlibs/"$WIN32"unix/unix.cma \ otherlibs/bigarray/bigarray.cmxa \ otherlibs/dbm/dbm.cmxa \ + otherlibs/dynlink/dynlink.cmxa \ otherlibs/"$WIN32"graph/graphics.cmxa \ otherlibs/num/nums.cmxa \ otherlibs/str/str.cmxa \ @@ -325,17 +326,17 @@ installdir \ otherlibs/labltk/support/tkthread.cmi \ otherlibs/labltk/support/tkthread.cmo \ otherlibs/labltk/support/tkthread.$O \ - otherlibs/labltk/labltk/*.mli \ + otherlibs/labltk/support/tkthread.cmx \ + otherlibs/labltk/labltk/[^_]*.mli \ otherlibs/labltk/labltk/*.cmi \ otherlibs/labltk/labltk/*.cmx \ - otherlibs/labltk/camltk/*.mli \ + otherlibs/labltk/camltk/[^_]*.mli \ otherlibs/labltk/camltk/*.cmi \ otherlibs/labltk/camltk/*.cmx \ otherlibs/labltk/frx/frxlib.cma \ otherlibs/labltk/frx/frxlib.cmxa \ - otherlibs/labltk/frx/*.mli \ + ../otherlibs/labltk/frx/*.mli \ otherlibs/labltk/frx/*.cmi \ - otherlibs/labltk/frx/*.cmx \ otherlibs/labltk/jpf/jpflib.cma \ otherlibs/labltk/jpf/jpflib.cmxa \ otherlibs/labltk/jpf/*.mli \ @@ -343,20 +344,27 @@ installdir \ otherlibs/labltk/jpf/*.cmx \ otherlibs/labltk/lib/labltk.cma \ otherlibs/labltk/lib/labltk.cmxa \ + otherlibs/labltk/lib/labltk.cmx \ otherlibs/labltk/tkanim/*.mli \ otherlibs/labltk/tkanim/*.cmi \ otherlibs/labltk/tkanim/tkanim.cma \ otherlibs/labltk/tkanim/tkanim.cmxa \ + otherlibs/labltk/compiler/tkcompiler \ $LIBDIR/labltk installdir \ otherlibs/systhreads/threads.cma \ otherlibs/systhreads/threads.cmxa \ otherlibs/systhreads/thread.cmi \ + otherlibs/systhreads/thread.cmx \ otherlibs/systhreads/mutex.cmi \ + otherlibs/systhreads/mutex.cmx \ otherlibs/systhreads/condition.cmi \ + otherlibs/systhreads/condition.cmx \ otherlibs/systhreads/event.cmi \ + otherlibs/systhreads/event.cmx \ otherlibs/systhreads/threadUnix.cmi \ + otherlibs/systhreads/threadUnix.cmx \ $LIBDIR/threads installdir \ @@ -420,50 +428,54 @@ installdir \ toplevel/topdirs.cmi \ toplevel/topmain.cmi \ typing/outcometree.cmi \ + typing/outcometree.mli \ otherlibs/graph/graphicsX11.cmi \ + otherlibs/graph/graphicsX11.mli \ otherlibs/dynlink/dynlink.cmi \ + otherlibs/dynlink/dynlink.mli \ otherlibs/num/arith_status.cmi \ + otherlibs/num/arith_status.mli \ otherlibs/num/big_int.cmi \ + otherlibs/num/big_int.mli \ otherlibs/num/nat.cmi \ + otherlibs/num/nat.mli \ otherlibs/num/num.cmi \ + otherlibs/num/num.mli \ otherlibs/num/ratio.cmi \ + otherlibs/num/ratio.mli \ otherlibs/bigarray/bigarray.cmi \ + otherlibs/bigarray/bigarray.mli \ otherlibs/dbm/dbm.cmi \ + otherlibs/dbm/dbm.mli \ + otherlibs/dynlink/dynlink.cmx \ otherlibs/"$WIN32"graph/graphics.cmi \ + otherlibs/"$WIN32"graph/graphics.mli \ otherlibs/str/str.cmi \ + otherlibs/str/str.mli \ otherlibs/"$WIN32"unix/unix.cmi \ + otherlibs/"$WIN32"unix/unix.mli \ otherlibs/"$WIN32"unix/unixLabels.cmi \ + otherlibs/"$WIN32"unix/unixLabels.mli \ otherlibs/num/arith_flags.cmx \ - otherlibs/num/arith_flags.$O \ otherlibs/num/int_misc.cmx \ - otherlibs/num/int_misc.$O \ otherlibs/num/arith_status.cmx \ - otherlibs/num/arith_status.$O \ otherlibs/num/big_int.cmx \ - otherlibs/num/big_int.$O \ otherlibs/num/nat.cmx \ - otherlibs/num/nat.$O \ otherlibs/num/num.cmx \ - otherlibs/num/num.$O \ otherlibs/num/ratio.cmx \ - otherlibs/num/ratio.$O \ otherlibs/bigarray/bigarray.cmx \ - otherlibs/bigarray/bigarray.$O \ otherlibs/dbm/dbm.cmx \ - otherlibs/dbm/dbm.$O \ otherlibs/"$WIN32"graph/graphics.cmx \ - otherlibs/"$WIN32"graph/graphics.$O \ + otherlibs/graph/graphicsX11.cmx \ otherlibs/str/str.cmx \ - otherlibs/str/str.$O \ otherlibs/"$WIN32"unix/unix.cmx \ - otherlibs/"$WIN32"unix/unix.$O \ otherlibs/"$WIN32"unix/unixLabels.cmx \ - otherlibs/"$WIN32"unix/unixLabels.$O \ $LIBDIR installlibdir \ otherlibs/bigarray/bigarray.$A \ otherlibs/dbm/dbm.$A \ + otherlibs/dynlink/dynlink.$A \ otherlibs/"$WIN32"graph/graphics.$A \ otherlibs/num/nums.$A \ otherlibs/str/str.$A \ diff --git a/build/otherlibs-targets.sh b/build/otherlibs-targets.sh index 2167dd334..199804243 100644 --- a/build/otherlibs-targets.sh +++ b/build/otherlibs-targets.sh @@ -1,5 +1,20 @@ #!/bin/sh + +######################################################################### +# # +# Objective Caml # +# # +# Nicolas Pouillard, projet Gallium, INRIA Rocquencourt # +# # +# Copyright 2008 Institut National de Recherche en Informatique et # +# en Automatique. All rights reserved. This file is distributed # +# under the terms of the GNU Library General Public License, with # +# the special exception on linking described in file LICENSE. # +# # +######################################################################### + # $Id$ + OTHERLIBS_BYTE="" OTHERLIBS_NATIVE="" OTHERLIBS_UNIX_NATIVE="" diff --git a/build/world.sh b/build/world.sh index a401e51db..bbe1632a9 100755 --- a/build/world.sh +++ b/build/world.sh @@ -25,7 +25,7 @@ fi ./mkconfig.sh ./mkmyocamlbuild_config.sh . ../config/config.sh -if [ "x$EXE" = "x.exe" ]; then +if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then ./boot-c-parts-windows.sh else ./boot-c-parts.sh diff --git a/byterun/Makefile b/byterun/Makefile index 5986bb295..151529451 100644 --- a/byterun/Makefile +++ b/byterun/Makefile @@ -22,14 +22,10 @@ OBJS=$(COMMONOBJS) unix.o main.o DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o PICOBJS=$(OBJS:.o=.pic.o) -TMP_SHARED_LIBRARIES=$(SUPPORTS_SHARED_LIBRARIES:false=) -SHARED_LIBRARIES_DEPS=$(TMP_SHARED_LIBRARIES:true=libcamlrun_shared.so) +SHARED_LIBS_TMP=$(SUPPORTS_SHARED_LIBRARIES:%false=) +SHARED_LIBS_DEPS=$(SHARED_LIBS_TMP:%true=libcamlrun_shared.so) -all:: $(SHARED_LIBRARIES_DEPS) - -install:: - if test -f libcamlrun_shared.so; then \ - cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi +all:: $(SHARED_LIBS_DEPS) ocamlrun$(EXE): libcamlrun.a prims.o $(MKEXE) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \ @@ -50,6 +46,14 @@ libcamlrund.a: $(DOBJS) libcamlrun_shared.so: $(PICOBJS) $(MKDLL) -o libcamlrun_shared.so $(PICOBJS) $(BYTECCLIBS) +install:: + if test -f libcamlrun_shared.so; then \ + cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi + +clean:: + rm -f libcamlrun_shared.so + + .SUFFIXES: .d.o .pic.o .c.d.o: diff --git a/byterun/Makefile.common b/byterun/Makefile.common index bac885f1c..db5a38c7a 100755 --- a/byterun/Makefile.common +++ b/byterun/Makefile.common @@ -86,7 +86,7 @@ jumptbl.h : instruct.h version.h : ../VERSION echo "#define OCAML_VERSION \"`head -1 ../VERSION`\"" > version.h -clean: +clean :: rm -f ocamlrun$(EXE) ocamlrund$(EXE) *.$(O) *.$(A) *.$(SO) rm -f primitives prims.c opnames.h jumptbl.h ld.conf rm -f version.h diff --git a/byterun/interp.c b/byterun/interp.c index 76cd2151f..feea1fbd6 100644 --- a/byterun/interp.c +++ b/byterun/interp.c @@ -113,7 +113,7 @@ sp is a local copy of the global variable caml_extern_sp. */ For GCC, I have hand-assigned hardware registers for several architectures. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(DEBUG) +#if defined(__GNUC__) && !defined(DEBUG) && !defined(__INTEL_COMPILER) && !defined(__llvm__) #ifdef __mips__ #define PC_REG asm("$16") #define SP_REG asm("$17") @@ -1215,6 +1215,12 @@ x11_link="not found" for dir in \ $x11_include_dir \ \ + /usr/X11R7/include \ + /usr/include/X11R7 \ + /usr/local/X11R7/include \ + /usr/local/include/X11R7 \ + /opt/X11R7/include \ + \ /usr/X11R6/include \ /usr/include/X11R6 \ /usr/local/X11R6/include \ diff --git a/debugger/parser.mly b/debugger/parser.mly index c94182f6b..db365a69e 100644 --- a/debugger/parser.mly +++ b/debugger/parser.mly @@ -182,6 +182,7 @@ longident_eol : opt_longident : UIDENT { Some (Lident $1) } + | LIDENT { Some (Lident $1) } | module_path DOT UIDENT { Some (Ldot($1, $3)) } | { None }; diff --git a/man/ocamldoc.m b/man/ocamldoc.m index 27cf1b53a..19a7f0332 100644 --- a/man/ocamldoc.m +++ b/man/ocamldoc.m @@ -110,10 +110,7 @@ to display it. .TP .BI \-g \ file Dynamically load the given file (which extension usually is .cmo or .cma), -which defines a custom documentation generator. This option is supported by the -.BR ocamldoc (1) -command, but not by its native-code version -.BR ocamldoc.opt . +which defines a custom documentation generator. If the given file is a simple one and does not exist in the current directory, then ocamldoc looks for it in the custom generators default directory, and in the directories specified with the diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 13775e4b5..ad787517c 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -1073,14 +1073,18 @@ let labltk_lib_contents = @ "tk" :: labltk_generated_modules @ "cTk" - :: camltk_generated_modules;; + :: camltk_generated_modules + @ ["labltk"; "camltk"];; let labltk_contents obj_ext = List.map (fun x -> "otherlibs/labltk/support"/x-.-obj_ext) labltk_support @ "otherlibs/labltk/labltk/tk"-.-obj_ext :: List.map (fun x -> "otherlibs/labltk/labltk"/x-.-obj_ext) labltk_generated_modules @ "otherlibs/labltk/camltk/cTk"-.-obj_ext - :: List.map (fun x -> "otherlibs/labltk/camltk"/x-.-obj_ext) camltk_generated_modules;; + :: List.map (fun x -> "otherlibs/labltk/camltk"/x-.-obj_ext) camltk_generated_modules + @ ["otherlibs/labltk/labltk/labltk"-.-obj_ext; + "otherlibs/labltk/camltk/camltk"-.-obj_ext] +;; let labltk_cma_contents = labltk_contents "cmo" in rule "labltk.cma" diff --git a/ocamldoc/Makefile.nt b/ocamldoc/Makefile.nt index 11d44b4f7..caba5769b 100644 --- a/ocamldoc/Makefile.nt +++ b/ocamldoc/Makefile.nt @@ -24,7 +24,7 @@ OCAMLBIN = $(BINDIR) OCAMLPP=-pp "grep -v DEBUG" -# For installation +# For installation ############## MKDIR=mkdir CP=cp @@ -179,18 +179,18 @@ OCAMLCMXFILES=$(OCAMLCMOFILES:.cmo=.cmx) all: exe lib exe: $(OCAMLDOC) -lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) +lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) opt.opt: exeopt libopt exeopt: $(OCAMLDOC_OPT) -libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) -debug: +libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) +debug: make OCAMLPP="" -$(OCAMLDOC): $(EXECMOFILES) +$(OCAMLDOC): $(EXECMOFILES) $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES) $(OCAMLDOC_OPT): $(EXECMXFILES) - $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) + $(OCAMLOPT) -o $@ unix.cmxa str.cmxa dynlink.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) $(OCAMLDOC_LIBCMA): $(LIBCMOFILES) $(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES) diff --git a/otherlibs/labltk/browser/lexical.ml b/otherlibs/labltk/browser/lexical.ml index a2573ef7c..72f1957ec 100644 --- a/otherlibs/labltk/browser/lexical.ml +++ b/otherlibs/labltk/browser/lexical.ml @@ -39,6 +39,8 @@ let tag ?(start=tstart) ?(stop=tend) tw = let tpos c = (Text.index tw ~index:start, [`Char c]) in let text = Text.get tw ~start ~stop in let buffer = Lexing.from_string text in + Location.init buffer ""; + Location.input_name := ""; List.iter tags ~f:(fun tag -> Text.tag_remove tw ~start ~stop ~tag); let last = ref (EOF, 0, 0) in diff --git a/otherlibs/labltk/browser/typecheck.ml b/otherlibs/labltk/browser/typecheck.ml index 890fd195b..d5347ef53 100644 --- a/otherlibs/labltk/browser/typecheck.ml +++ b/otherlibs/labltk/browser/typecheck.ml @@ -46,8 +46,12 @@ let preprocess ~pp ~ext text = exception Outdated_version let parse_pp ~parse ~wrap ~ext text = + Location.input_name := ""; match !Clflags.preprocessor with - None -> parse (Lexing.from_string text) + None -> + let buffer = Lexing.from_string text in + Location.init buffer ""; + parse buffer | Some pp -> let tmpfile = preprocess ~pp ~ext text in let ast_magic = @@ -72,7 +76,9 @@ let parse_pp ~parse ~wrap ~ext text = failwith "Ocaml and preprocessor have incompatible versions" | _ -> seek_in ic 0; - parse (Lexing.from_channel ic) + let buffer = Lexing.from_channel ic in + Location.init buffer ""; + parse buffer in close_in ic; Sys.remove tmpfile; diff --git a/otherlibs/labltk/examples_camltk/Makefile.nt b/otherlibs/labltk/examples_camltk/Makefile.nt index 13f27a01d..d07471bc0 100644 --- a/otherlibs/labltk/examples_camltk/Makefile.nt +++ b/otherlibs/labltk/examples_camltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../camltk -I ../support diff --git a/otherlibs/labltk/examples_labltk/Makefile.nt b/otherlibs/labltk/examples_labltk/Makefile.nt index 825d9e42b..261bf7543 100644 --- a/otherlibs/labltk/examples_labltk/Makefile.nt +++ b/otherlibs/labltk/examples_labltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../labltk -I ../support diff --git a/otherlibs/num/big_int.ml b/otherlibs/num/big_int.ml index 933721ca5..9c74eb4c8 100644 --- a/otherlibs/num/big_int.ml +++ b/otherlibs/num/big_int.ml @@ -378,7 +378,9 @@ let int64_of_big_int bi = else begin let i = match num_digits_big_int bi with - | 1 -> Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0) + | 1 -> Int64.logand + (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) + 0xFFFFFFFFL | 2 -> Int64.logor (Int64.logand (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) diff --git a/otherlibs/num/test/test_big_ints.ml b/otherlibs/num/test/test_big_ints.ml index 572b86863..8fdd04b40 100644 --- a/otherlibs/num/test/test_big_ints.ml +++ b/otherlibs/num/test/test_big_ints.ml @@ -771,14 +771,16 @@ test 3 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775808"), -9223372036854775808L);; test 4 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775"), -9223372036854775L);; +test 5 eq_int64 (* PR#4804 *) + (int64_of_big_int (big_int_of_string "2147483648"), 2147483648L);; let should_fail s = try ignore (int64_of_big_int (big_int_of_string s)); 0 with Failure _ -> 1;; -test 4 eq_int +test 6 eq_int (should_fail "9223372036854775808", 1);; -test 5 eq_int +test 7 eq_int (should_fail "-9223372036854775809", 1);; -test 6 eq_int +test 8 eq_int (should_fail "18446744073709551616", 1);; (* build a 128-bit big int from two int64 *) diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index d91d707b4..042eaef9e 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -35,15 +35,14 @@ value win_create_process_native(value cmd, value cmdline, value env, envp = NULL; } /* Prepare stdin/stdout/stderr redirection */ - GetStartupInfo(&si); - si.dwFlags |= STARTF_USESTDHANDLES; + ZeroMemory(&si, sizeof(STARTUPINFO)); + si.cb = sizeof(STARTUPINFO); + si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = Handle_val(fd1); si.hStdOutput = Handle_val(fd2); si.hStdError = Handle_val(fd3); /* If we do not have a console window, then we must create one before running the process (keep it hidden for apparence). - Also one must suppress spurious flags in si.dwFlags. - Otherwise the redirections are ignored. If we are starting a GUI application, the newly created console should not matter. */ if (win_has_console()) diff --git a/typing/mtype.ml b/typing/mtype.ml index 7cacac807..50455fb50 100644 --- a/typing/mtype.ml +++ b/typing/mtype.ml @@ -51,11 +51,13 @@ and strengthen_sig env sg p = match decl.type_manifest with Some ty when decl.type_private = Public -> decl | _ -> - { decl with - type_private = Public; - type_manifest = - Some(Btype.newgenty(Tconstr(Pdot(p, Ident.name id, nopos), - decl.type_params, ref Mnil))) } + let manif = + Some(Btype.newgenty(Tconstr(Pdot(p, Ident.name id, nopos), + decl.type_params, ref Mnil))) in + if decl.type_kind = Type_abstract then + { decl with type_private = Public; type_manifest = manif } + else + { decl with type_manifest = manif } in Tsig_type(id, newdecl, rs) :: strengthen_sig env rem p | (Tsig_exception(id, d) as sigelt) :: rem -> diff --git a/typing/typedecl.ml b/typing/typedecl.ml index 4ebfb4632..f8635162e 100644 --- a/typing/typedecl.ml +++ b/typing/typedecl.ml @@ -41,6 +41,7 @@ type error = | Bad_variance of int * (bool * bool) * (bool * bool) | Unavailable_type_constructor of Path.t | Bad_fixed_type of string + | Unbound_type_var_exc of type_expr * type_expr exception Error of Location.t * error @@ -686,10 +687,16 @@ let transl_type_decl env name_sdecl_list = (final_decls, final_env) (* Translate an exception declaration *) +let transl_closed_type env sty = + let ty = transl_simple_type env true sty in + match Ctype.free_variables ty with + | [] -> ty + | tv :: _ -> raise (Error (sty.ptyp_loc, Unbound_type_var_exc (tv, ty))) + let transl_exception env excdecl = reset_type_variables(); Ctype.begin_def(); - let types = List.map (transl_simple_type env true) excdecl in + let types = List.map (transl_closed_type env) excdecl in Ctype.end_def(); List.iter Ctype.generalize types; types @@ -808,6 +815,38 @@ let check_recmod_typedecl env loc recmod_ids path decl = open Format +let explain_unbound ppf tv tl typ kwd lab = + try + let ti = List.find (fun ti -> Ctype.deep_occur tv (typ ti)) tl in + let ty0 = (* Hack to force aliasing when needed *) + Btype.newgenty (Tobject(tv, ref None)) in + Printtyp.reset_and_mark_loops_list [typ ti; ty0]; + fprintf ppf + ".@.@[<hov2>In %s@ %s%a@;<1 -2>the variable %a is unbound@]" + kwd (lab ti) Printtyp.type_expr (typ ti) Printtyp.type_expr tv + with Not_found -> () + +let explain_unbound_single ppf tv ty = + let trivial ty = + explain_unbound ppf tv [ty] (fun t -> t) "type" (fun _ -> "") in + match (Ctype.repr ty).desc with + Tobject(fi,_) -> + let (tl, rv) = Ctype.flatten_fields fi in + if rv == tv then trivial ty else + explain_unbound ppf tv tl (fun (_,_,t) -> t) + "method" (fun (lab,_,_) -> lab ^ ": ") + | Tvariant row -> + let row = Btype.row_repr row in + if row.row_more == tv then trivial ty else + explain_unbound ppf tv row.row_fields + (fun (l,f) -> match Btype.row_field_repr f with + Rpresent (Some t) -> t + | Reither (_,[t],_,_) -> t + | Reither (_,tl,_,_) -> Btype.newgenty (Ttuple tl) + | _ -> Btype.newgenty (Ttuple[])) + "case" (fun (lab,_) -> "`" ^ lab ^ " of ") + | _ -> trivial ty + let report_error ppf = function | Repeated_parameter -> fprintf ppf "A type parameter occurs several times" @@ -858,46 +897,20 @@ let report_error ppf = function | Unbound_type_var (ty, decl) -> fprintf ppf "A type variable is unbound in this type declaration"; let ty = Ctype.repr ty in - let explain tl typ kwd lab = - let ti = List.find (fun ti -> Ctype.deep_occur ty (typ ti)) tl in - let ty0 = (* Hack to force aliasing when needed *) - Btype.newgenty (Tobject(ty, ref None)) in - Printtyp.reset_and_mark_loops_list [typ ti; ty0]; - fprintf ppf - ".@.@[<hov2>In %s@ %s%a@;<1 -2>the variable %a is unbound@]" - kwd (lab ti) Printtyp.type_expr (typ ti) Printtyp.type_expr ty - in - begin try match decl.type_kind, decl.type_manifest with + begin match decl.type_kind, decl.type_manifest with Type_variant tl, _ -> - explain tl (fun (_,tl) -> Btype.newgenty (Ttuple tl)) + explain_unbound ppf ty tl (fun (_,tl) -> Btype.newgenty (Ttuple tl)) "case" (fun (lab,_) -> lab ^ " of ") | Type_record (tl, _), _ -> - explain tl (fun (_,_,t) -> t) + explain_unbound ppf ty tl (fun (_,_,t) -> t) "field" (fun (lab,_,_) -> lab ^ ": ") | Type_abstract, Some ty' -> - let trivial ty = - explain [ty] (fun t -> t) "definition" (fun _ -> "") in - begin match (Ctype.repr ty').desc with - Tobject(fi,_) -> - let (tl, rv) = Ctype.flatten_fields fi in - if rv == ty then trivial ty' else - explain tl (fun (_,_,t) -> t) - "method" (fun (lab,_,_) -> lab ^ ": ") - | Tvariant row -> - let row = Btype.row_repr row in - if row.row_more == ty then trivial ty' else - explain row.row_fields - (fun (l,f) -> match Btype.row_field_repr f with - Rpresent (Some t) -> t - | Reither (_,[t],_,_) -> t - | Reither (_,tl,_,_) -> Btype.newgenty (Ttuple tl) - | _ -> Btype.newgenty (Ttuple[])) - "case" (fun (lab,_) -> "`" ^ lab ^ " of ") - | _ -> trivial ty' - end + explain_unbound_single ppf ty ty' | _ -> () - with Not_found -> () end + | Unbound_type_var_exc (tv, ty) -> + fprintf ppf "A type variable is unbound in this exception declaration"; + explain_unbound_single ppf (Ctype.repr tv) ty | Unbound_exception lid -> fprintf ppf "Unbound exception constructor@ %a" Printtyp.longident lid | Not_an_exception lid -> diff --git a/typing/typedecl.mli b/typing/typedecl.mli index fe54126ea..89d73f2f2 100644 --- a/typing/typedecl.mli +++ b/typing/typedecl.mli @@ -70,6 +70,7 @@ type error = | Bad_variance of int * (bool*bool) * (bool*bool) | Unavailable_type_constructor of Path.t | Bad_fixed_type of string + | Unbound_type_var_exc of type_expr * type_expr exception Error of Location.t * error diff --git a/typing/typetexp.ml b/typing/typetexp.ml index dc9165f75..ec2b7ed8d 100644 --- a/typing/typetexp.ml +++ b/typing/typetexp.ml @@ -355,12 +355,8 @@ let rec transl_type env policy styp = row_fixed = false; row_name = !name } in let static = Btype.static_row row in let row = - if static then row else - match policy with - Fixed -> - raise (Error (styp.ptyp_loc, Unbound_type_variable "..")) - | Extensible -> row - | Univars -> { row with row_more = new_pre_univar () } + if static || policy <> Univars then row + else { row with row_more = new_pre_univar () } in newty (Tvariant row) | Ptyp_poly(vars, st) -> @@ -392,12 +388,8 @@ and transl_fields env policy = function [] -> newty Tnil - | ({pfield_desc = Pfield_var} as pf)::_ -> - begin match policy with - Fixed -> raise (Error (pf.pfield_loc, Unbound_type_variable "..")) - | Extensible -> newvar () - | Univars -> new_pre_univar () - end + | {pfield_desc = Pfield_var}::_ -> + if policy = Univars then new_pre_univar () else newvar () | {pfield_desc = Pfield(s, e)}::l -> let ty1 = transl_type env policy e in let ty2 = transl_fields env policy l in diff --git a/yacc/reader.c b/yacc/reader.c index 6c8e4a278..d3c275572 100644 --- a/yacc/reader.c +++ b/yacc/reader.c @@ -163,6 +163,7 @@ char *substring (char *str, int start, int len) for (i = 0; i < len; i++){ buf[i] = str[start+i]; } + buf[i] = '\0'; /* PR#4796 */ return buf; } @@ -710,7 +711,7 @@ get_literal(void) n = cinc; s = MALLOC(n); if (s == 0) no_space(); - + for (i = 0; i < n; ++i) s[i] = cache[i]; @@ -1306,7 +1307,7 @@ loop: { ++cptr; i = get_number(); - + if (i <= 0 || i > n) unknown_rhs(i); item = pitem[nitems + i - n - 1]; @@ -1393,7 +1394,7 @@ loop: fwrite(cptr, 1, 2, f); cptr += 2; } else - if (cptr[0] == '\\' + if (cptr[0] == '\\' && isdigit((unsigned char) cptr[1]) && isdigit((unsigned char) cptr[2]) && isdigit((unsigned char) cptr[3]) |