Generic compare that crash at runtime

One of the pitfall of OCaml that seems completely at odd with the language design has always been the generic comparators: use them on the wrong value type and your program will crash at runtimne, despite the compiler not emitting a single warning. For instance:

$ echo let x = compare (+) (-) > boum.ml
$ ocamlc boum.m
# No warning here
$ ./a.out
Fatal error: exception Invalid_argument("compare: functional value")
Raised by primitive operation at unknown location (inlined)

I know of only two cases where one get this behavior:

  1. comparing any type that embodies any function
  2. comparing external values with no comparison operator defined

In both cases (but esp the first case) it seems to me the compiler should be able to emit a warning.
Am I missing something?

Replying to myself: Just found that this has been answered already by gasche here: Removing polymorphic compare from Core - #12 by gasche