When I compile and Execute this piece of code. It prints nothing.
let main list = let rec xyz list = match list with |[]->[] |m::body -> begin print_int m; xyz body end in xyz let h = main [1;2;3] If xyz is used outside of main is working without any error and printing 1 2 and 3
-w +A, if you are using ocamlc or ocamlopt directly. In the file itself adding[@@@warning "+A"]at the top of the file will be equivalent. And Dune has a better set of warning enabled by default.unused-varwarning is enabled by default, so you shouldn't need to do anything. Turning on all warnings isn't a bad idea though. Or even-warn-error +Ato turn them into errors.hvariable though, which also does not seem to be used as its type is not what one would expect from the function.