This is a C compiler warning you can ignore. I’m guessing it’s caused by ctypes and I don’t think it’s worth the effort to fix it if it would make ctypes more complicated. (const here leads to a warning rather than an error, the datatype is correct.)
the provided error warning was given when the ‘opam install plplot’ command failed. I did try later to manually build the plplot-ocaml github repository, but received the same warning.
I have since tested the opam install plplot command with switches ( 4.08.1, 5.0.0, 5.3.1+options) to the same effect,
looking at the _build/log for the local repository
the build command/s for the external library where
$ /home/jacobw/.opam/4.14.2/bin/ocamlc.opt -config > /tmp/dune_c97c72_output
$ (cd _build/default/src && /usr/lib64/ccache/gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -I/usr/include/plplot -g -I /home/jacobw/.opam/4.14.2/lib/ocaml -o idlalloc.o -c idlalloc.c)
$ (cd _build/default/src && /usr/lib64/ccache/gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -g -O2 -I/usr/include/plplot -g -I /home/jacobw/.opam/4.14.2/lib/ocaml -o plplot_impl.o -c plplot_impl.c)
I’ve tried changing the flag configurations within the src/dune file : removing :standard , and adding -w. to no particular effect.
dune seems to still be using the flags given to it by ocamlc.opt -options (which includes -fno-strict-aliasing) for the gcc command, and I am not certain how to prevent dune from passing them in.
Squinting, that looks pretty much like your gcc invocation, doesn’t it? I don’t see the difference.
So I thought: why don’t I run the command? And yeah, the command goes thru without any trouble. Could I suggest that you do the same? That is, take the command from your build/log and run it in a shell?
And also, what’s the output of “gcc --version” on your machine?
Last: can you turn off this “ccache” stuff? Is that perhaps related to your problem?
Since GCC 14, passing pointers with incompatible types is no longer just a warning, it is a hard error. You need to pass the option -Wno-error=incompatible-pointer-types to revert to the old behavior of GCC.
I was able to build plplot successfully by adding both
-w and -Wno-error=incompatible-pointer-types
to the src/dune flags list
neither of the flags individually resolved the build failure.