Original bug ID: 7658 Reporter: cspiel Assigned to:@mshinwell Status: resolved (set by @mshinwell on 2017-10-20T09:44:28Z) Resolution: duplicate Priority: normal Severity: minor Platform: amd64 OS: GNU/Linux OS Version: 4.9.0 Target version: 4.06.0 +dev/beta1/beta2/rc1 Category: runtime system and C interface
Bug description
If the current git sources (0b09fb5) are
configured with `-force-safe-string' the compilation of module
"spacetime_snapshot.c" breaks with the following error message:
In file included from ../byterun/caml/alloc.h:24:0,
from spacetime_snapshot.c:23:
spacetime_snapshot.c: In function ‘copy_string_outside_heap’:
../byterun/caml/mlvalues.h:256:23: error: passing argument 1 of ‘memmove’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
#define String_val(x) ((const char *) Bp_val(x))
^
spacetime_snapshot.c:359:11: note: in expansion of macro ‘String_val’
memmove(String_val(result), s, len);
^~~~~~~~~~
In file included from spacetime_snapshot.c:19:0:
/usr/include/string.h:46:14: note: expected ‘void *’ but argument is of type ‘const char *’
extern void *memmove (void *__dest, const void *__src, size_t __n)
^~~~~~~
cc1: all warnings being treated as errors
Steps to reproduce
./configure -flambda -force-safe-string -no-naked-pointers -spacetime -with-frame-pointers
make world.opt
Additional information
The origin of this problem sits in file "mlvalues.h". There macro String_val' is conditionally defined with respect to CAML_SAFE_STRING'.
However, the solution will have to be non-trivial as the error points
to the change in semantics, i.e. value vs. address.
The text was updated successfully, but these errors were encountered:
Original bug ID: 7658
Reporter: cspiel
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2017-10-20T09:44:28Z)
Resolution: duplicate
Priority: normal
Severity: minor
Platform: amd64
OS: GNU/Linux
OS Version: 4.9.0
Target version: 4.06.0 +dev/beta1/beta2/rc1
Category: runtime system and C interface
Bug description
If the current git sources (0b09fb5) are
configured with `-force-safe-string' the compilation of module
"spacetime_snapshot.c" breaks with the following error message:
In file included from ../byterun/caml/alloc.h:24:0,
from spacetime_snapshot.c:23:
spacetime_snapshot.c: In function ‘copy_string_outside_heap’:
../byterun/caml/mlvalues.h:256:23: error: passing argument 1 of ‘memmove’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
#define String_val(x) ((const char *) Bp_val(x))
^
spacetime_snapshot.c:359:11: note: in expansion of macro ‘String_val’
memmove(String_val(result), s, len);
^~~~~~~~~~
In file included from spacetime_snapshot.c:19:0:
/usr/include/string.h:46:14: note: expected ‘void *’ but argument is of type ‘const char *’
extern void *memmove (void *__dest, const void *__src, size_t __n)
^~~~~~~
cc1: all warnings being treated as errors
Steps to reproduce
./configure -flambda -force-safe-string -no-naked-pointers -spacetime -with-frame-pointers
make world.opt
Additional information
The origin of this problem sits in file "mlvalues.h". There macro
String_val' is conditionally defined with respect to
CAML_SAFE_STRING'.However, the solution will have to be non-trivial as the error points
to the change in semantics, i.e. value vs. address.
The text was updated successfully, but these errors were encountered: