Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007658OCamlruntime system and C interfacepublic2017-10-16 10:032017-10-20 14:41
Reportercspiel 
Assigned Toshinwell 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionduplicate 
Platformamd64OSGNU/LinuxOS Version4.9.0
Product Version 
Target Version4.06.0 +dev/beta1/beta2/rc1Fixed in Version 
Summary0007658: Compilation of "spacetime_snapshot.c" breaks if configured with `-force-safe-string'
DescriptionIf the current git sources (0b09fb56a5bbea5a72a6c1705fced8f8372dd6ff) 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 InformationThe 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018580)
gasche (developer)
2017-10-16 10:17

Thanks for the report! Hopefully we can fix it before the 4.06 release.
(0018606)
shinwell (developer)
2017-10-20 11:42

Please see https://github.com/ocaml/ocaml/pull/1439 [^]
(0018609)
cspiel (reporter)
2017-10-20 14:41

With the patch the compilation succeeds.
Spacetime profiling works. THX!

- Issue History
Date Modified Username Field Change
2017-10-16 10:03 cspiel New Issue
2017-10-16 10:17 gasche Note Added: 0018580
2017-10-16 10:17 gasche Assigned To => shinwell
2017-10-16 10:17 gasche Status new => acknowledged
2017-10-16 10:18 gasche Category configure and build/install => runtime system and C interface
2017-10-16 10:18 gasche Target Version => 4.06.0 +dev/beta1/beta2/rc1
2017-10-20 10:59 shinwell Assigned To shinwell =>
2017-10-20 11:00 shinwell Assigned To => shinwell
2017-10-20 11:00 shinwell Status acknowledged => assigned
2017-10-20 11:42 shinwell Note Added: 0018606
2017-10-20 11:44 shinwell Status assigned => resolved
2017-10-20 11:44 shinwell Resolution open => duplicate
2017-10-20 14:41 cspiel Note Added: 0018609


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker