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

SEE ALSO

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