Builtin\_attributes(3) OCaml library Builtin\_attributes(3)

# [NAME](#NAME)

Builtin\_attributes - Support for some of the builtin attributes

# [Module](#Module)

Module Builtin\_attributes

# [Documentation](#Documentation)

Module **Builtin\_attributes**  
: **sig end**

Support for some of the builtin attributes

-ocaml.deprecated

-ocaml.alert

-ocaml.error

-ocaml.ppwarning

-ocaml.warning

-ocaml.warnerror

-ocaml.explicit\_arity (for camlp4/camlp5)

-ocaml.warn\_on\_literal\_pattern

-ocaml.deprecated\_mutable

-ocaml.immediate

-ocaml.immediate64

-ocaml.boxed / ocaml.unboxed

Warning: this module is unstable and part of **Compiler\_libs** .

*val check\_alerts* : **Location.t -&gt; Parsetree.attributes -&gt; string -&gt; unit**

*val check\_alerts\_inclusion* : **def:Location.t -&gt;** **use:Location.t -&gt;** **Location.t -&gt; Parsetree.attributes -&gt; Parsetree.attributes -&gt; string -&gt; unit**

*val alerts\_of\_attrs* : **Parsetree.attributes -&gt; Misc.alerts**

*val alerts\_of\_sig* : **Parsetree.signature -&gt; Misc.alerts**

*val alerts\_of\_str* : **Parsetree.structure -&gt; Misc.alerts**

*val check\_deprecated\_mutable* : **Location.t -&gt; Parsetree.attributes -&gt; string -&gt; unit**

*val check\_deprecated\_mutable\_inclusion* : **def:Location.t -&gt;** **use:Location.t -&gt;** **Location.t -&gt; Parsetree.attributes -&gt; Parsetree.attributes -&gt; string -&gt; unit**

*val check\_no\_alert* : **Parsetree.attributes -&gt; unit**

*val error\_of\_extension* : **Parsetree.extension -&gt; Location.error**

*val warning\_attribute* : **?ppwarning:bool -&gt; Parsetree.attribute -&gt; unit**

Apply warning settings from the specified attribute. "ocaml.warning"/"ocaml.warnerror" (and variants without the prefix) are processed and other attributes are ignored.

Also implement ocaml.ppwarning (unless ~ppwarning:false is passed).

*val warning\_scope* : **?ppwarning:bool -&gt; Parsetree.attributes -&gt; (unit -&gt; 'a) -&gt; 'a**

Execute a function in a new scope for warning settings. This means that the effect of any call to **warning\_attribute** during the execution of this function will be discarded after execution.

The function also takes a list of attributes which are processed with **warning\_attribute** in the fresh scope before the function is executed.

*val warn\_on\_literal\_pattern* : **Parsetree.attributes -&gt; bool**

*val explicit\_arity* : **Parsetree.attributes -&gt; bool**

*val immediate* : **Parsetree.attributes -&gt; bool**

*val immediate64* : **Parsetree.attributes -&gt; bool**

*val has\_unboxed* : **Parsetree.attributes -&gt; bool**

*val has\_boxed* : **Parsetree.attributes -&gt; bool**

2026-09-15 OCamldoc

---

Document: Builtin_attributes(3o) from ocaml-4 4.14.4-r3 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
