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

SEE ALSO

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