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  option  is
351              given,  specify  the name of the output file produced.  This can
352              also be used when compiling an interface or implementation file,
353              without  linking,  in  which case it sets the name of the cmi or
354              cmo file, and also sets the module name to the file name  up  to
355              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       -pack  Build a bytecode object file (.cmo file) and its associated com‐
381              piled interface (.cmi) that combines the object files  given  on
382              the  command line, making them appear as sub-modules of the out‐
383              put .cmo file.  The name of the output .cmo file must  be  given
384              with       the       -o       option.        For       instance,
385              ocamlc -pack -o p.cmo a.cmo b.cmo c.cmo generates compiled files
386              p.cmo  and p.cmi describing a compilation unit having three sub-
387              modules A, B and C, corresponding to the contents of the  object
388              files  a.cmo, b.cmo and c.cmo.  These contents can be referenced
389              as P.A, P.B and P.C in the remainder of the program.
390
391       -pp command
392              Cause the compiler to call the given command as  a  preprocessor
393              for  each source file. The output of command is redirected to an
394              intermediate file, which is compiled. If there are  no  compila‐
395              tion  errors,  the  intermediate file is deleted afterwards. The
396              name of this file is built from the basename of the source  file
397              with  the  extension  .ppi for an interface (.mli) file and .ppo
398              for an implementation (.ml) file.
399
400       -ppx command
401              After parsing, pipe the abstract syntax tree  through  the  pre‐
402              processor  command.  The module Ast_mapper(3) implements the ex‐
403              ternal interface of a preprocessor.
404
405       -principal
406              Check information path during type-checking, to make  sure  that
407              all  types  are derived in a principal way.  When using labelled
408              arguments and/or polymorphic methods, this flag is  required  to
409              ensure  future  versions  of  the compiler will be able to infer
410              types correctly, even if internal algorithms change.   All  pro‐
411              grams  accepted  in -principal mode are also accepted in the de‐
412              fault mode with equivalent types, but  different  binary  signa‐
413              tures,  and  this  may slow down type checking; yet it is a good
414              idea to use it once before publishing source code.
415
416       -rectypes
417              Allow arbitrary recursive types during  type-checking.   By  de‐
418              fault,  only recursive types where the recursion goes through an
419              object type are supported. Note that once you  have  created  an
420              interface  using this flag, you must use it again for all depen‐
421              dencies.
422
423       -runtime-variant suffix
424              Add suffix to the name of the runtime library that will be  used
425              by  the  program.  If OCaml was configured with option -with-de‐
426              bug-runtime, then the d suffix is supported and  gives  a  debug
427              version of the runtime.
428
429       -stop-after pass
430              Stop compilation after the given compilation pass. The currently
431              supported passes are: parsing, typing.
432
433       -safe-string
434              Enforce the separation between types  string and bytes,  thereby
435              making strings read-only. This is the default.
436
437       -short-paths
438              When  a  type  is  visible  under  several module-paths, use the
439              shortest one when printing the type's name  in  inferred  inter‐
440              faces and error and warning messages.
441
442       -strict-sequence
443              Force the left-hand part of each sequence to have type unit.
444
445       -unboxed-types
446              When  a  type is unboxable (i.e. a record with a single argument
447              or a concrete datatype with a single constructor  of  one  argu‐
448              ment) it will be unboxed unless annotated with [@@ocaml.boxed].
449
450       -no-unboxed-types
451              When a type is unboxable  it will be boxed unless annotated with
452              [@@ocaml.unboxed].  This is the default.
453
454       -unsafe
455              Turn bound checking off  for  array  and  string  accesses  (the
456              v.(i)ands.[i]  constructs).  Programs  compiled with -unsafe are
457              therefore slightly faster, but unsafe: anything  can  happen  if
458              the program accesses an array or string outside of its bounds.
459
460       -unsafe-string
461              Identify  the  types  string and bytes,  thereby  making strings
462              writable.  This is intended for compatibility  with  old  source
463              code and should not be used with new software.
464
465       -use-runtime runtime-name
466              Generate  a bytecode executable file that can be executed on the
467              custom  runtime  system   runtime-name,   built   earlier   with
468              ocamlc -make-runtime runtime-name.
469
470       -v     Print the version number of the compiler and the location of the
471              standard library directory, then exit.
472
473       -verbose
474              Print all external commands before they are executed, in partic‐
475              ular  invocations  of the C compiler and linker in -custom mode.
476              Useful to debug C library problems.
477
478       -vnum or -version
479              Print the version number of the compiler  in  short  form  (e.g.
480              "3.11.0"), then exit.
481
482       -w warning-list
483              Enable,  disable, or mark as fatal the warnings specified by the
484              argument warning-list.
485
486              Each warning can be enabled or disabled, and each warning can be
487              fatal or  non-fatal.   If  a  warning is disabled, it isn't dis‐
488              played and doesn't affect compilation in any way (even if it  is
489              fatal).   If  a  warning is enabled, it is displayed normally by
490              the compiler whenever the source code triggers it.  If it is en‐
491              abled and fatal, the compiler will also stop with an error after
492              displaying it.
493
494              The warning-list argument is a sequence of  warning  specifiers,
495              with  no separators between them.  A warning specifier is one of
496              the following:
497
498              +num   Enable warning number num.
499
500              -num   Disable warning number num.
501
502              @num   Enable and mark as fatal warning number num.
503
504              +num1..num2   Enable all warnings between num1 and num2  (inclu‐
505              sive).
506
507              -num1..num2   Disable all warnings between num1 and num2 (inclu‐
508              sive).
509
510              @num1..num2   Enable and mark as fatal all warnings between num1
511              and num2 (inclusive).
512
513              +letter    Enable  the  set of warnings corresponding to letter.
514              The letter may be uppercase or lowercase.
515
516              -letter   Disable the set of warnings corresponding  to  letter.
517              The letter may be uppercase or lowercase.
518
519              @letter    Enable  and  mark as fatal the set of warnings corre‐
520              sponding to letter.  The letter may be uppercase or lowercase.
521
522              uppercase-letter   Enable the set of warnings  corresponding  to
523              uppercase-letter.
524
525              lowercase-letter    Disable the set of warnings corresponding to
526              lowercase-letter.
527
528              The warning numbers are as follows.
529
530              1    Suspicious-looking start-of-comment mark.
531
532              2    Suspicious-looking end-of-comment mark.
533
534              3    Deprecated feature.
535
536              4    Fragile pattern matching: matching that  will  remain  com‐
537              plete  even  if  additional constructors are added to one of the
538              variant types matched.
539
540              5    Partially applied function:  expression  whose  result  has
541              function type and is ignored.
542
543              6    Label omitted in function application.
544
545              7    Method overridden without using the "method!" keyword.
546
547              8    Partial match: missing cases in pattern-matching.
548
549              9    Missing fields in a record pattern.
550
551              10   Expression on the left-hand side of a sequence that doesn't
552              have type unit (and that is not a function, see  warning  number
553              5).
554
555              11   Redundant case in a pattern matching (unused match case).
556
557              12   Redundant sub-pattern in a pattern-matching.
558
559              13   Override of an instance variable.
560
561              14   Illegal backslash escape in a string constant.
562
563              15   Private method made public implicitly.
564
565              16   Unerasable optional argument.
566
567              17   Undeclared virtual method.
568
569              18   Non-principal type.
570
571              19   Type without principality.
572
573              20   Unused function argument.
574
575              21   Non-returning statement.
576
577              22   Preprocessor warning.
578
579              23   Useless record with clause.
580
581              24    Bad module name: the source file name is not a valid OCaml
582              module name.
583
584              25   Deprecated: now part of warning 8.
585
586              26   Suspicious unused variable: unused variable that  is  bound
587              with let or as, and doesn't start with an underscore (_) charac‐
588              ter.
589
590              27   Innocuous unused variable:  unused  variable  that  is  not
591              bound  with let nor as, and doesn't start with an underscore (_)
592              character.
593
594              28   A pattern contains a constant constructor  applied  to  the
595              underscore (_) pattern.
596
597              29    A  non-escaped end-of-line was found in a string constant.
598              This may cause portability problems between Unix and Windows.
599
600              30   Two labels or constructors of the same name are defined  in
601              two mutually recursive types.
602
603              31   A module is linked twice in the same executable.
604
605              32   Unused value declaration.
606
607              33   Unused open statement.
608
609              34   Unused type declaration.
610
611              35   Unused for-loop index.
612
613              36   Unused ancestor variable.
614
615              37   Unused constructor.
616
617              38   Unused extension constructor.
618
619              39   Unused rec flag.
620
621              40   Constructor or label name used out of scope.
622
623              41   Ambiguous constructor or label name.
624
625              42   Disambiguated constructor or label name.
626
627              43   Nonoptional label applied as optional.
628
629              44   Open statement shadows an already defined identifier.
630
631              45    Open  statement  shadows  an already defined label or con‐
632              structor.
633
634              46   Error in environment variable.
635
636              47   Illegal attribute payload.
637
638              48   Implicit elimination of optional arguments.
639
640              49   Missing cmi file when looking up module alias.
641
642              50   Unexpected documentation comment.
643
644              59   Assignment on non-mutable value.
645
646              60   Unused module declaration.
647
648              61   Unannotated unboxable type in primitive declaration.
649
650              62   Type constraint on GADT type declaration.
651
652              63   Erroneous printed signature.
653
654              64   -unsafe used with a preprocessor returning a syntax tree.
655
656              65   Type declaration defining a new '()' constructor.
657
658              66   Unused open! statement.
659
660              67   Unused functor parameter.
661
662              68   Pattern-matching depending on mutable  state  prevents  the
663              remaining arguments from being uncurried.
664
665              The  letters stand for the following sets of warnings.  Any let‐
666              ter not mentioned here corresponds to the empty set.
667
668              A  all warnings
669
670              C  1, 2
671
672              D  3
673
674              E  4
675
676              F  5
677
678              K  32, 33, 34, 35, 36, 37, 38, 39
679
680              L  6
681
682              M  7
683
684              P  8
685
686              R  9
687
688              S  10
689
690              U  11, 12
691
692              V  13
693
694              X  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30
695
696              Y  26
697
698              Z  27
699
700
701              The               default               setting               is
702              -w +a-4-6-7-9-27-29-30-32..42-44-45-48-50-60-66-67-68.      Note
703              that warnings 5 and 10 are not always  triggered,  depending  on
704              the internals of the type checker.
705
706       -warn-error warning-list
707              Mark  as  errors  the  warnings  specified in the argument warn‐
708              ing-list.  The compiler will stop with  an  error  when  one  of
709              these  warnings is emitted.  The warning-list has the same mean‐
710              ing as for the -w option: a +  sign  (or  an  uppercase  letter)
711              marks the corresponding warnings as fatal, a - sign (or a lower‐
712              case letter) turns them back into non-fatal warnings,  and  a  @
713              sign both enables and marks as fatal the corresponding warnings.
714
715              Note:  it  is  not  recommended to use the -warn-error option in
716              production code, because it will almost certainly  prevent  com‐
717              piling  your  program with later versions of OCaml when they add
718              new warnings or modify existing warnings.
719
720              The default setting is -warn-error -a+31 (only warning 31 is fa‐
721              tal).
722
723       -warn-help
724              Show the description of all available warning numbers.
725
726       -where Print the location of the standard library, then exit.
727
728       -with-runtime
729              Include the runtime system in the generated program. This is the
730              default.
731
732       -without-runtime
733              The compiler does not include the runtime system (nor  a  refer‐
734              ence  to it) in the generated program; it must be supplied sepa‐
735              rately.
736
737       - file Process file as a file name, even if it starts with a  dash  (-)
738              character.
739
740       -help or --help
741              Display a short usage summary and exit.
742
743

SEE ALSO

745       ocamlopt(1), ocamlrun(1), ocaml(1).
746       The OCaml user's manual, chapter "Batch compilation".
747
748
749
750                                                                     OCAMLC(1)
Impressum