garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

lablgtk3 fails to compile with OCaml 4.10 [pre-release] #92

Closed ejgallego closed 4 years ago

ejgallego commented 4 years ago

Changes in the runtime produce this error:

      ocamlc src/ml_gpointer.o (exit 2)
(cd _build/default/src && /home/egallego/.opam/4.10.0+trunk/bin/ocamlc.opt -g -I /home/egallego/.opam/4.10.0+trunk/lib/cairo2 -I /home/egallego/.opam/4.10.0+trunk/lib/ocaml/threads -ccopt -pthread -ccopt -I/usr/include/gtk-3.0 -ccopt -I/usr/include/at-spi2-atk/2.0 -ccopt -I/usr/include/at-spi-2.0 -ccopt -I/usr/include/dbus-1.0 -ccopt -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -ccopt -I/usr/include/gtk-3.0 -ccopt -I/usr/include/gio-unix-2.0 -ccopt -I/usr/include/cairo -ccopt -I/usr/include/libdrm -ccopt -I/usr/include/pango-1.0 -ccopt -I/usr/include/harfbuzz -ccopt -I/usr/include/pango-1.0 -ccopt -I/usr/include/fribidi -ccopt -I/usr/include/atk-1.0 -ccopt -I/usr/include/cairo -ccopt -I/usr/include/pixman-1 -ccopt -I/usr/include/freetype2 -ccopt -I/usr/include/libpng16 -ccopt -I/usr/include/gdk-pixbuf-2.0 -ccopt -I/usr/include/libmount -ccopt -I/usr/include/blkid -ccopt -I/usr/include/uuid -ccopt -I/usr/include/glib-2.0 -ccopt -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -ccopt -Wno-deprecated-declarations -ccopt -g -o ml_gpointer.o ml_gpointer.c)
In file included from /home/egallego/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:20,
                 from ml_gpointer.c:25:
/home/egallego/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:245:32: error: expected ‘)’ before ‘->’ token
 #define young_start (Caml_state->_young_start)
                                ^~
wrappers.h:36:18: note: in expansion of macro ‘young_start’
 CAMLextern char *young_start, *young_end; /* from minor_gc.h */
                  ^~~~~~~~~~~
ml_gpointer.c: In function ‘ml_stable_copy’:
ml_gpointer.c:36:35: warning: comparison of distinct pointer types lacks a cast
     if (Is_block(v) && (char*)(v) < young_end && (char*)(v) > young_start)
                                   ^
ml_gpointer.c:36:61: warning: comparison of distinct pointer types lacks a cast
     if (Is_block(v) && (char*)(v) < young_end && (char*)(v) > young_start)
garrigue commented 4 years ago

There are two problems:

garrigue commented 4 years ago

It seems that ocaml exports minor_gc.h since at least 4.05 (it was not exported in 4.03), so there seems to be no need to keep the definitions of young_start and young_end.

garrigue commented 4 years ago

Fixed in master and lablgtk3 by #93 and #97