# Troubles using alerts

**URL:** <https://discuss.ocaml.org/t/troubles-using-alerts/8803>\
**Category:** Learning\
**Tags:** warnings, alerts\
**Created:** [November 12, 2021, 10:51pm UTC](https://discuss.ocaml.org/t/troubles-using-alerts/8803 "2021-11-12T22:51:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kakadu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kakadu/32/1204_2.png) [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Post date:** [November 12, 2021, 10:51pm UTC](https://discuss.ocaml.org/t/troubles-using-alerts/8803/1 "2021-11-12T22:51:20Z")

</div>

I’m trying to use alerts to report non-implemented functions as warnings. But my alerts are not shown during compilation. (I think any alerts are not shown on compilation) Where could be an issue?

```ocaml
[@@@alert unsafe "This module is unsafe!"]

module X = struct
  let is_interesting_var _ _ =
    (assert false [@alert not_implemented "Not implemented"])
    [@@deprecated "Not implemented"]

  [@@@ocaml.alert deprecated "Please implement stuff above"]
end

let _ = X.is_interesting_var 1 2

```

```auto
➜ ocamlc -alert +not_implemented -alert +deprecated -alert +unsafe -alert +all -w +3 -c a.ml   
➜ ocamlc -version                                                                  
4.12.1

```

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [November 13, 2021, 6:45am UTC](https://discuss.ocaml.org/t/troubles-using-alerts/8803/2 "2021-11-13T06:45:38Z")

</div>

I’m not sure that alerts can be attached to implementations that way. In principle they can be attached to signatures:

```auto
module X : sig
  val is_interesting_var : _ -> _ -> _
  [@@alert unsafe "xyz"]
end = struct
  let is_interesting_var _ _ =
    assert false
end [@@ocaml.alert deprecated "Please implement stuff above"]

let _ = X.is_interesting_var 1 2

```

Moreover, the top-level form `[@@@alert ...]` is used to toggle specific alerts. See the manual [OCaml - Language extensions](https://ocaml.org/manual/alerts.html) for more.

Cheers,  
Nicolas
