1OCAMLC(1)                   General Commands Manual                  OCAMLC(1)
2
3
4

NAME

6       ocamlc - The OCaml bytecode compiler
7
8

SYNOPSIS

10       ocamlc [ options ] filename ...
11
12       ocamlc.opt [ options ] filename ...
13
14

DESCRIPTION

16       The  OCaml  bytecode  compiler ocamlc(1) compiles OCaml source files to
17       bytecode object files and links these object files  to  produce  stand‐
18       alone  bytecode  executable files.  These executable files are then run
19       by the bytecode interpreter ocamlrun(1).
20
21       The ocamlc(1) command has a command-line interface similar to  the  one
22       of  most  C  compilers.  It accepts several types of arguments and pro‐
23       cesses them sequentially, after all options have been processed:
24
25       Arguments ending in .mli are taken to be source files  for  compilation
26       unit  interfaces.  Interfaces specify the names exported by compilation
27       units: they declare value names with their types,  define  public  data
28       types, declare abstract data types, and so on. From the file x.mli, the
29       ocamlc(1) compiler produces a compiled interface in the file x.cmi.
30
31       Arguments ending in .ml are taken to be source  files  for  compilation
32       unit implementations. Implementations provide definitions for the names
33       exported by the unit, and also contain expressions to be evaluated  for
34       their  side-effects.   From  the file x.ml, the ocamlc(1) compiler pro‐
35       duces compiled object bytecode in the file x.cmo.
36
37       If the interface file x.mli exists, the implementation x.ml is  checked
38       against the corresponding compiled interface x.cmi, which is assumed to
39       exist. If no interface x.mli is provided, the compilation of x.ml  pro‐
40       duces  a  compiled  interface  file  x.cmi  in addition to the compiled
41       object code file x.cmo.  The file  x.cmi  produced  corresponds  to  an
42       interface that exports everything that is defined in the implementation
43       x.ml.
44
45       Arguments ending in .cmo are taken  to  be  compiled  object  bytecode.
46       These  files  are linked together, along with the object files obtained
47       by compiling .ml arguments (if any), and the OCaml standard library, to
48       produce a standalone executable program. The order in which .cmo and.ml
49       arguments are presented on the command line  is  relevant:  compilation
50       units  are initialized in that order at run-time, and it is a link-time
51       error to use a component of a unit before having initialized it. Hence,
52       a  given  x.cmo  file must come before all .cmo files that refer to the
53       unit x.
54
55       Arguments ending in .cma are taken to be libraries of object  bytecode.
56       A  library  of  object  bytecode packs in a single file a set of object
57       bytecode files (.cmo files). Libraries are built  with  ocamlc -a  (see
58       the  description of the -a option below). The object files contained in
59       the library are linked as regular .cmo files (see above), in the  order
60       specified  when the .cma file was built. The only difference is that if
61       an object file contained in a library is not referenced anywhere in the
62       program, then it is not linked in.
63
64       Arguments  ending in .c are passed to the C compiler, which generates a
65       .o object file. This object file is linked  with  the  program  if  the
66       -custom flag is set (see the description of -custom below).
67
68       Arguments  ending  in  .o  or  .a  are assumed to be C object files and
69       libraries. They are passed to the C linker when linking in -custom mode
70       (see the description of -custom below).
71
72       Arguments  ending  in  .so are assumed to be C shared libraries (DLLs).
73       During linking, they are searched for external C  functions  referenced
74       from the OCaml code, and their names are written in the generated byte‐
75       code executable.  The  run-time  system  ocamlrun(1)  then  loads  them
76       dynamically at program start-up time.
77
78       The  output of the linking phase is a file containing compiled bytecode
79       that can be executed by the OCaml  bytecode  interpreter:  the  command
80       ocamlrun(1).  If caml.out is the name of the file produced by the link‐
81       ing phase, the command ocamlrun caml.out  arg1  arg2 ... argn  executes
82       the  compiled  code  contained in caml.out, passing it as arguments the
83       character strings arg1 to argn.  (See ocamlrun(1) for more details.)
84
85       On most systems, the file produced by the  linking  phase  can  be  run
86       directly, as in: ./caml.out arg1  arg2 ... argn.  The produced file has
87       the executable bit set, and it manages to launch  the  bytecode  inter‐
88       preter by itself.
89
90       ocamlc.opt  is  the  same  compiler  as  ocamlc,  but compiled with the
91       native-code  compiler  ocamlopt(1).   Thus,  it  behaves  exactly  like
92       ocamlc,  but  compiles  faster.  ocamlc.opt may not be available in all
93       installations of OCaml.
94
95

OPTIONS

97       The following command-line options are recognized by ocamlc(1).
98
99       -a     Build a library (.cma file) with the object files  (.cmo  files)
100              given  on the command line, instead of linking them into an exe‐
101              cutable file. The name of the library must be set  with  the  -o
102              option.
103
104              If  -custom, -cclib or -ccopt  options are passed on the command
105              line, these options are stored in the  resulting  .cma  library.
106              Then,  linking  with  this  library  automatically adds back the
107              -custom, -cclib and -ccopt options as if they had been  provided
108              on  the  command  line,  unless the -noautolink option is given.
109              Additionally, a substring $CAMLORIGIN inside a   -ccopt  options
110              will be replaced by the full path to the .cma library, excluding
111              the filename.  -absname Show absolute filenames  in  error  mes‐
112              sages.
113
114       -annot Dump  detailed  information  about the compilation (types, bind‐
115              ings, tail-calls, etc).  The information for file src.ml is  put
116              into  file  src.annot.   In  case  of a type error, dump all the
117              information inferred by the type-checker before the  error.  The
118              src.annot  file  can  be  used  with the emacs commands given in
119              emacs/caml-types.el  to  display  types  and  other  annotations
120              interactively.
121
122       -bin-annot
123              Dump  detailed  information  about the compilation (types, bind‐
124              ings, tail-calls, etc) in binary  format.  The  information  for
125              file  src.ml is put into file src.cmt.  In case of a type error,
126              dump all the information inferred by the type-checker before the
127              error.  The annotation files produced by -bin-annot contain more
128              information and are much more compact than the files produced by
129              -annot.
130
131       -c     Compile  only.  Suppress  the  linking phase of the compilation.
132              Source code files are turned into compiled files,  but  no  exe‐
133              cutable  file is produced. This option is useful to compile mod‐
134              ules separately.
135
136       -cc ccomp
137              Use ccomp as the C linker when linking in "custom runtime"  mode
138              (see  the -custom option) and as the C compiler for compiling .c
139              source files.
140
141       -cclib -llibname
142              Pass the -llibname option to the C linker when linking in  "cus‐
143              tom  runtime"  mode  (see  the  -custom option). This causes the
144              given C library to be linked with the program.
145
146       -ccopt option
147              Pass the given option to the C compiler and linker, when linking
148              in "custom runtime" mode (see the -custom option). For instance,
149              -ccopt -Ldir causes the C linker to search for  C  libraries  in
150              directory dir.
151
152       -color mode
153              Enable  or disable colors in compiler messages (especially warn‐
154              ings and errors).  The following modes are supported:
155
156              auto use heuristics to enable colors only if the output supports
157              them (an ANSI-compatible tty terminal);
158
159              always enable colors unconditionally;
160
161              never disable color output.
162
163              The  default  setting  is auto, and the current heuristic checks
164              that the "TERM" environment variable exists and is not empty  or
165              "dumb", and that isatty(stderr) holds.
166
167              The  environment  variable "OCAML_COLOR" is considered if -color
168              is not provided. Its values are auto/always/never as above.
169
170
171       -error-style mode
172              Control the way error messages and warnings  are  printed.   The
173              following modes are supported:
174
175              short only print the error and its location;
176
177              contextual  like "short", but also display the source code snip‐
178              pet corresponding to the location of the error.
179
180              The default setting is contextual.
181
182              The environment variable "OCAML_ERROR_STYLE"  is  considered  if
183              -error-style is not provided. Its values are short/contextual as
184              above.
185
186
187       -compat-32
188              Check that the generated bytecode executable can run  on  32-bit
189              platforms  and signal an error if it cannot. This is useful when
190              compiling bytecode on a 64-bit machine.
191
192       -config
193              Print the version number of ocamlc(1) and a detailed summary  of
194              its configuration, then exit.
195
196       -config-var
197              Print  the  value  of a specific configuration variable from the
198              -config output, then exit. If the variable does not  exist,  the
199              exit code is non-zero.
200
201       -custom
202              Link  in "custom runtime" mode. In the default linking mode, the
203              linker produces bytecode that is intended to  be  executed  with
204              the  shared  runtime system, ocamlrun(1).  In the custom runtime
205              mode, the linker produces an output file that contains both  the
206              runtime  system  and the bytecode for the program. The resulting
207              file is larger, but it can be executed  directly,  even  if  the
208              ocamlrun(1) command is not installed. Moreover, the "custom run‐
209              time" mode enables linking OCaml code with user-defined C  func‐
210              tions.
211
212              Never  use  the  strip(1)  command  on  executables  produced by
213              ocamlc -custom, this would remove the bytecode part of the  exe‐
214              cutable.
215
216              Security  warning:  never  set  the "setuid" or "setgid" bits on
217              executables produced by ocamlc -custom,  this  would  make  them
218              vulnerable to attacks.
219
220       -depend ocamldep-args
221              Compute dependencies, as ocamldep would do.
222
223       -dllib -llibname
224              Arrange  for  the  C  shared  library dlllibname.so to be loaded
225              dynamically by the run-time system ocamlrun(1) at program start-
226              up time.
227
228       -dllpath dir
229              Adds  the directory dir to the run-time search path for shared C
230              libraries.  At link-time, shared libraries are searched  in  the
231              standard  search  path (the one corresponding to the -I option).
232              The -dllpath option simply stores dir in the produced executable
233              file, where ocamlrun(1) can find it and use it.
234
235       -for-pack module-path
236              Generate  an  object file (.cmo file) that can later be included
237              as a sub-module (with the given access path)  of  a  compilation
238              unit      constructed     with     -pack.      For     instance,
239              ocamlc -for-pack P -c A.ml will generate a.cmo that can later be
240              used with ocamlc -pack -o P.cmo a.cmo.  Note: you can still pack
241              a module that was compiled without -for-pack but  in  this  case
242              exceptions will be printed with the wrong names.
243
244       -g     Add  debugging  information  while  compiling  and linking. This
245              option is required in order to be able to debug the program with
246              ocamldebug(1)  and  to produce stack backtraces when the program
247              terminates on an uncaught exception.
248
249       -i     Cause the compiler  to  print  all  defined  names  (with  their
250              inferred types or their definitions) when compiling an implemen‐
251              tation (.ml file). No compiled files (.cmo and .cmi  files)  are
252              produced.  This can be useful to check the types inferred by the
253              compiler. Also, since the output follows the  syntax  of  inter‐
254              faces,  it can help in writing an explicit interface (.mli file)
255              for a file: just redirect the standard output of the compiler to
256              a  .mli  file,  and edit that file to remove all declarations of
257              unexported names.
258
259       -I directory
260              Add the given directory to the list of directories searched  for
261              compiled  interface  files  (.cmi),  compiled  object code files
262              (.cmo),  libraries  (.cma),  and  C  libraries  specified   with
263              -cclib -lxxx  .   By  default, the current directory is searched
264              first, then the standard library  directory.  Directories  added
265              with  -I  are searched after the current directory, in the order
266              in which they were given on the command  line,  but  before  the
267              standard library directory. See also option -nostdlib.
268
269              If  the  given  directory starts with +, it is taken relative to
270              the standard library directory. For instance,  -I +compiler-libs
271              adds  the  subdirectory compiler-libs of the standard library to
272              the search path.
273
274       -impl filename
275              Compile the file filename as an implementation file, even if its
276              extension is not .ml.
277
278       -intf filename
279              Compile  the  file  filename  as  an interface file, even if its
280              extension is not .mli.
281
282       -intf-suffix string
283              Recognize file names  ending  with  string  as  interface  files
284              (instead of the default .mli).
285
286       -keep-docs
287              Keep documentation strings in generated .cmi files.
288
289       -keep-locs
290              Keep locations in generated .cmi files.
291
292       -labels
293              Labels  are not ignored in types, labels may be used in applica‐
294              tions, and labelled parameters can be given in any order.   This
295              is the default.
296
297       -linkall
298              Force  all  modules  contained  in libraries to be linked in. If
299              this flag is not given, unreferenced modules are not linked  in.
300              When building a library (option -a), setting the -linkall option
301              forces all subsequent links of programs involving  that  library
302              to  link all the modules contained in the library.  When compil‐
303              ing a module (option -c), setting the  -linkall  option  ensures
304              that this module will always be linked if it is put in a library
305              and this library is linked.
306
307       -make-runtime
308              Build a custom runtime system (in the file specified  by  option
309              -o)  incorporating the C object files and libraries given on the
310              command line.  This custom runtime system can be used  later  to
311              execute   bytecode   executables   produced   with   the  option
312              ocamlc -use-runtime runtime-name.
313
314       -match-context-rows
315              Set number of rows of context used during pattern matching  com‐
316              pilation.  Lower values cause faster compilation, but less opti‐
317              mized code. The default value is 32.
318
319       -no-alias-deps
320              Do not record dependencies for module aliases.
321
322       -no-app-funct
323              Deactivates the applicative behaviour  of  functors.  With  this
324              option,  each  functor  application  generates  new types in its
325              result and applying the same functor twice to the same  argument
326              yields two incompatible structures.
327
328       -noassert
329              Do  not  compile  assertion  checks.  Note that the special form
330              assert false is always compiled because it is  typed  specially.
331              This flag has no effect when linking already-compiled files.
332
333       -noautolink
334              When  linking  .cma libraries, ignore -custom, -cclib and -ccopt
335              options potentially contained in the libraries (if these options
336              were  given when building the libraries).  This can be useful if
337              a library contains incorrect specifications of C libraries or  C
338              options;  in this case, during linking, set -noautolink and pass
339              the correct C libraries and options on the command line.
340
341       -nolabels
342              Ignore non-optional labels in types. Labels cannot  be  used  in
343              applications, and parameter order becomes strict.
344
345       -nostdlib
346              Do  not  automatically add the standard library directory to the
347              list  of  directories  searched  for  compiled  interface  files
348              (.cmi), compiled object code files (.cmo), libraries (.cma), and
349              C libraries specified with -cclib -lxxx .  See also option -I.
350
351       -o exec-file
352              Specify the name of the output file produced by the linker.  The
353              default  output  name  is a.out, in keeping with the Unix tradi‐
354              tion. If the -a option is given, specify the name of the library
355              produced.  If the -pack option is given, specify the name of the
356              packed object file  produced.   If  the  -output-obj  option  is
357              given,  specify  the name of the output file produced.  This can
358              also be used when compiling an interface or implementation file,
359              without  linking,  in  which case it sets the name of the cmi or
360              cmo file, and also sets the module name to the file name  up  to
361              the first dot.
362
363       -opaque
364              Interface  file  compiled  with  this  option are marked so that
365              other compilation units depending on it will  not  rely  on  any
366              implementation  details  of  the  compiled  implementation.  The
367              native compiler will not access the .cmx file of  this  unit  --
368              nor warn if it is absent. This can improve speed of compilation,
369              for both initial and incremental builds, at the expense of  per‐
370              formance of the generated code.
371
372       -open module
373              Opens the given module before processing the interface or imple‐
374              mentation files. If several -open options are  given,  they  are
375              processed  in  order,  just as if the statements open! module1;;
376              ... open! moduleN;; were added at the top of each file.
377
378       -output-obj
379              Cause the linker to produce a C object file instead of  a  byte‐
380              code  executable  file. This is useful to wrap OCaml code as a C
381              library, callable from any C program. The  name  of  the  output
382              object file must be set with the -o option. This option can also
383              be used to produce a C source file (.c extension) or a  compiled
384              shared/dynamic library (.so extension).
385
386       -pack  Build a bytecode object file (.cmo file) and its associated com‐
387              piled interface (.cmi) that combines the object files  given  on
388              the  command line, making them appear as sub-modules of the out‐
389              put .cmo file.  The name of the output .cmo file must  be  given
390              with       the       -o       option.        For       instance,
391              ocamlc -pack -o p.cmo a.cmo b.cmo c.cmo generates compiled files
392              p.cmo  and p.cmi describing a compilation unit having three sub-
393              modules A, B and C, corresponding to the contents of the  object
394              files  a.cmo, b.cmo and c.cmo.  These contents can be referenced
395              as P.A, P.B and P.C in the remainder of the program.
396
397       -plugin plugin
398              Dynamically load the code of the given plugin (a .cmo,  .cma  or
399              .cmxs  file)  in the compiler. The plugin must exist in the same
400              kind of code as the compiler  (ocamlc.byte  must  load  bytecode
401              plugins,  while  ocamlc.opt  must load native code plugins), and
402              extension adaptation is done automatically for  .cma  files  (to
403              .cmxs files if the compiler is compiled in native code).
404
405       -pp command
406              Cause  the  compiler to call the given command as a preprocessor
407              for each source file. The output of command is redirected to  an
408              intermediate  file,  which is compiled. If there are no compila‐
409              tion errors, the intermediate file is  deleted  afterwards.  The
410              name  of this file is built from the basename of the source file
411              with the extension .ppi for an interface (.mli)  file  and  .ppo
412              for an implementation (.ml) file.
413
414       -ppx command
415              After  parsing,  pipe  the abstract syntax tree through the pre‐
416              processor command.   The  module  Ast_mapper(3)  implements  the
417              external interface of a preprocessor.
418
419       -principal
420              Check  information  path during type-checking, to make sure that
421              all types are derived in a principal way.  When  using  labelled
422              arguments  and/or  polymorphic methods, this flag is required to
423              ensure future versions of the compiler will  be  able  to  infer
424              types  correctly,  even if internal algorithms change.  All pro‐
425              grams accepted in -principal  mode  are  also  accepted  in  the
426              default  mode with equivalent types, but different binary signa‐
427              tures, and this may slow down type checking; yet it  is  a  good
428              idea to use it once before publishing source code.
429
430       -rectypes
431              Allow   arbitrary  recursive  types  during  type-checking.   By
432              default, only recursive types where the recursion  goes  through
433              an object type are supported. Note that once you have created an
434              interface using this flag, you must use it again for all  depen‐
435              dencies.
436
437       -runtime-variant suffix
438              Add  suffix to the name of the runtime library that will be used
439              by  the  program.   If  OCaml   was   configured   with   option
440              -with-debug-runtime,  then the d suffix is supported and gives a
441              debug version of the runtime.
442
443       -stop-after pass
444              Stop compilation after the given compilation pass. The currently
445              supported passes are: parsing, typing.
446
447       -safe-string
448              Enforce  the  separation between types string and bytes, thereby
449              making strings read-only. This is the default.
450
451       -short-paths
452              When a type is  visible  under  several  module-paths,  use  the
453              shortest  one  when  printing the type's name in inferred inter‐
454              faces and error and warning messages.
455
456       -strict-sequence
457              Force the left-hand part of each sequence to have type unit.
458
459       -unboxed-types
460              When a type is unboxable (i.e. a record with a  single  argument
461              or  a  concrete  datatype with a single constructor of one argu‐
462              ment) it will be unboxed unless annotated with [@@ocaml.boxed].
463
464       -no-unboxed-types
465              When a type is unboxable  it will be boxed unless annotated with
466              [@@ocaml.unboxed].  This is the default.
467
468       -unsafe
469              Turn  bound  checking  off  for  array  and string accesses (the
470              v.(i)ands.[i] constructs). Programs compiled  with  -unsafe  are
471              therefore  slightly  faster,  but unsafe: anything can happen if
472              the program accesses an array or string outside of its bounds.
473
474       -unsafe-string
475              Identify the  types  string and bytes,  thereby  making  strings
476              writable.   This  is  intended for compatibility with old source
477              code and should not be used with new software.
478
479       -use-runtime runtime-name
480              Generate a bytecode executable file that can be executed on  the
481              custom   runtime   system   runtime-name,   built  earlier  with
482              ocamlc -make-runtime runtime-name.
483
484       -v     Print the version number of the compiler and the location of the
485              standard library directory, then exit.
486
487       -verbose
488              Print all external commands before they are executed, in partic‐
489              ular invocations of the C compiler and linker in  -custom  mode.
490              Useful to debug C library problems.
491
492       -vmthread
493              Deprecated  since  OCaml  4.08.0.  Compile or link multithreaded
494              programs, in  combination  with  the  VM-level  threads  library
495              described in The OCaml user's manual.
496
497       -vnum or -version
498              Print  the  version  number  of the compiler in short form (e.g.
499              "3.11.0"), then exit.
500
501       -w warning-list
502              Enable, disable, or mark as fatal the warnings specified by  the
503              argument warning-list.
504
505              Each warning can be enabled or disabled, and each warning can be
506              fatalor non-fatal.  If a warning is disabled, it isn't displayed
507              and doesn't affect compilation in any way (even if it is fatal).
508              If a warning is enabled, it is displayed normally  by  the  com‐
509              piler  whenever  the  source code triggers it.  If it is enabled
510              and fatal, the compiler will also stop with an error after  dis‐
511              playing it.
512
513              The  warning-list  argument is a sequence of warning specifiers,
514              with no separators between them.  A warning specifier is one  of
515              the following:
516
517              +num   Enable warning number num.
518
519              -num   Disable warning number num.
520
521              @num   Enable and mark as fatal warning number num.
522
523              +num1..num2    Enable all warnings between num1 and num2 (inclu‐
524              sive).
525
526              -num1..num2   Disable all warnings between num1 and num2 (inclu‐
527              sive).
528
529              @num1..num2   Enable and mark as fatal all warnings between num1
530              and num2 (inclusive).
531
532              +letter   Enable the set of warnings  corresponding  to  letter.
533              The letter may be uppercase or lowercase.
534
535              -letter    Disable  the set of warnings corresponding to letter.
536              The letter may be uppercase or lowercase.
537
538              @letter   Enable and mark as fatal the set  of  warnings  corre‐
539              sponding to letter.  The letter may be uppercase or lowercase.
540
541              uppercase-letter    Enable  the set of warnings corresponding to
542              uppercase-letter.
543
544              lowercase-letter   Disable the set of warnings corresponding  to
545              lowercase-letter.
546
547              The warning numbers are as follows.
548
549              1    Suspicious-looking start-of-comment mark.
550
551              2    Suspicious-looking end-of-comment mark.
552
553              3    Deprecated feature.
554
555              4     Fragile  pattern  matching: matching that will remain com‐
556              plete even if additional constructors are added to  one  of  the
557              variant types matched.
558
559              5     Partially  applied  function:  expression whose result has
560              function type and is ignored.
561
562              6    Label omitted in function application.
563
564              7    Method overridden without using the "method!" keyword
565
566              8    Partial match: missing cases in pattern-matching.
567
568              9    Missing fields in a record pattern.
569
570              10   Expression on the left-hand side of a sequence that doesn't
571              have  type  unit (and that is not a function, see warning number
572              5).
573
574              11   Redundant case in a pattern matching (unused match case).
575
576              12   Redundant sub-pattern in a pattern-matching.
577
578              13   Override of an instance variable.
579
580              14   Illegal backslash escape in a string constant.
581
582              15   Private method made public implicitly.
583
584              16   Unerasable optional argument.
585
586              17   Undeclared virtual method.
587
588              18   Non-principal type.
589
590              19   Type without principality.
591
592              20   Unused function argument.
593
594              21   Non-returning statement.
595
596              22   Preprocessor warning.
597
598              23   Useless record with clause.
599
600              24   Bad module name: the source file name is not a valid  OCaml
601              module name.
602
603              25   Deprecated: now part of warning 8.
604
605              26    Suspicious  unused variable: unused variable that is bound
606              with let or as, and doesn't start with an underscore (_) charac‐
607              ter.
608
609              27    Innocuous  unused  variable:  unused  variable that is not
610              bound with let nor as, and doesn't start with an underscore  (_)
611              character.
612
613              28    A  pattern  contains a constant constructor applied to the
614              underscore (_) pattern.
615
616              29   A non-escaped end-of-line was found in a  string  constant.
617              This may cause portability problems between Unix and Windows.
618
619              30    Two labels or constructors of the same name are defined in
620              two mutually recursive types.
621
622              31   A module is linked twice in the same executable.
623
624              32   Unused value declaration.
625
626              33   Unused open statement.
627
628              34   Unused type declaration.
629
630              35   Unused for-loop index.
631
632              36   Unused ancestor variable.
633
634              37   Unused constructor.
635
636              38   Unused extension constructor.
637
638              39   Unused rec flag.
639
640              40   Constructor or label name used out of scope.
641
642              41   Ambiguous constructor or label name.
643
644              42   Disambiguated constructor or label name.
645
646              43   Nonoptional label applied as optional.
647
648              44   Open statement shadows an already defined identifier.
649
650              45   Open statement shadows an already  defined  label  or  con‐
651              structor.
652
653              46   Error in environment variable.
654
655              47   Illegal attribute payload.
656
657              48   Implicit elimination of optional arguments.
658
659              49   Missing cmi file when looking up module alias.
660
661              50   Unexpected documentation comment.
662
663              59   Assignment on non-mutable value.
664
665              60   Unused module declaration.
666
667              61   Unannotated unboxable type in primitive declaration.
668
669              62   Type constraint on GADT type declaration
670
671              63   Erroneous printed signature
672
673              64   -unsafe used with a preprocessor returning a syntax tree
674
675              65   Type declaration defining a new '()' constructor
676
677              66   Unused open! statement.
678
679              The  letters stand for the following sets of warnings.  Any let‐
680              ter not mentioned here corresponds to the empty set.
681
682              A  all warnings
683
684              C  1, 2
685
686              D  3
687
688              E  4
689
690              F  5
691
692              K  32, 33, 34, 35, 36, 37, 38, 39
693
694              L  6
695
696              M  7
697
698              P  8
699
700              R  9
701
702              S  10
703
704              U  11, 12
705
706              V  13
707
708              X  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30
709
710              Y  26
711
712              Z  27
713
714
715              The               default               setting               is
716              -w +a-4-6-7-9-27-29-32..42-44-45-48-50-60-66.   Note  that warn‐
717              ings 5 and 10 are not always triggered, depending on the  inter‐
718              nals of the type checker.
719
720       -warn-error warning-list
721              Mark  as  errors  the  warnings  specified in the argument warn‐
722              ing-list.  The compiler will stop with  an  error  when  one  of
723              these  warnings is emitted.  The warning-list has the same mean‐
724              ing as for the -w option: a +  sign  (or  an  uppercase  letter)
725              marks the corresponding warnings as fatal, a - sign (or a lower‐
726              case letter) turns them back into non-fatal warnings,  and  a  @
727              sign both enables and marks as fatal the corresponding warnings.
728
729              Note:  it  is  not  recommended to use the -warn-error option in
730              production code, because it will almost certainly  prevent  com‐
731              piling  your  program with later versions of OCaml when they add
732              new warnings or modify existing warnings.
733
734              The default setting is -warn-error -a+31  (only  warning  31  is
735              fatal).
736
737       -warn-help
738              Show the description of all available warning numbers.
739
740       -where Print the location of the standard library, then exit.
741
742       - file Process  file  as a file name, even if it starts with a dash (-)
743              character.
744
745       -help or --help
746              Display a short usage summary and exit.
747
748

SEE ALSO

750       ocamlopt(1), ocamlrun(1), ocaml(1).
751       The OCaml user's manual, chapter "Batch compilation".
752
753
754
755                                                                     OCAMLC(1)
Impressum