You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with CAML_SAFE_STRING being the default in recent ocaml releases. When CAML_SAFE_STRING is defined, swig's memcpy() is a compiler error, for example (from graphviz):
gv_ocaml.cpp:1324:2: error: no matching function for call to 'memcpy'
memcpy(String_val(SWIG_Field(vv,0)),p,len);
^~~~~~
/usr/include/string.h:72:7: note: candidate function not viable: no known conversion from 'const char *' to 'void *' for 1st argument
void *memcpy(void *__dst, const void *__src, size_t __n);
^
Essentially, swig seems to be trying to copy data to a location that is declared as const. If I undef CAML_SAFE_STRING, compiling succeeds (no problem to write data to a non-const destination). I don't know anything about ocaml or swig, just that CAML_SAFE_STRING is the default in ocaml and therefore graphviz is blocked.
The text was updated successfully, but these errors were encountered:
I originally filed this as a FTBFS in graphviz, but now I think the actual cause is a bug in swig. In line 372 of ocaml/ocamlrun.swg:
String_val() might be prototyped to return (char *) or (const char *) in ocaml's mlvalues.h:
with CAML_SAFE_STRING being the default in recent ocaml releases. When CAML_SAFE_STRING is defined, swig's memcpy() is a compiler error, for example (from graphviz):
Essentially, swig seems to be trying to copy data to a location that is declared as const. If I undef CAML_SAFE_STRING, compiling succeeds (no problem to write data to a non-const destination). I don't know anything about ocaml or swig, just that CAML_SAFE_STRING is the default in ocaml and therefore graphviz is blocked.
The text was updated successfully, but these errors were encountered: