Commit Graph

98 Commits (49aa87c316c441aa47974e8e9191a5a7e6d03d9a)

Author SHA1 Message Date
hhugo 49aa87c316
Introduce warning 68 to warn about hidden allocation due to pattern match of mutable field in curried functions (#9751)
Introduce new warning 68
2020-08-17 09:47:36 +01:00
Krzysztof Leśniak 761dec8c4a Add missing space 2020-07-07 21:55:36 +02:00
muskangarg21 50866e4cbf [nitpick]: Added "." at the end of warning descriptions in utils/warnings.ml 2020-03-30 21:48:02 +05:30
Nicolás Ojeda Bär 57d329e07b
Deprecate -annot (#2141)
* Move driver code from Cmt2annot to Read_cmt
* Move cmt2annot.ml into typing/
* make depend
* Use standard error handling
* Move specific logic to read_cmt
* Do not pass full cmt record as argument
* Better locations
* Emit .annot files produced from cmt data
* Remove direct calls to Stypes
* Deprecate -annot
* Changes
* make depend
* Adapt doc
* make -C tools depend
2020-03-13 12:59:34 +01:00
Andre e10d0ac160
Document warning 67 in ocamlc man page (#9346) 2020-03-09 19:38:48 +01:00
Gabriel Scherer 92a260fdf6 disable warning 30 (same constructor/label used in two mutually-recursive decls)
Warning 30 warns when the same constructor/label is used in two
mutually-recursive type declarations. This warning (added in OCaml
3.12, 2010) was meaningful at the time where constructor/label
conflicts had a shadowing semantics: the "last" definition would mean,
while ideally mutually-recursive definitions should not be strictly
ordered but defined "all at once".

Since OCaml 4.01 (2013) we support type-based disambiguation of
constructor/label names and it is now common to write code such as,
say

    type pattern = Var of var | ...
    type expr = Var of var | ...

(no warning, of course). But warning 30 fires if you instead write

    type pattern = Var of var | ...
    and expr = Var of var | ...

This doesn't make much sense, and in particular it certainly makes no
sense to enable this warning by default. The present PR disables it by
default.
2019-10-16 18:25:54 +02:00
Lucas Pluvinage 198d650245 without-runtime: cosmetic tweaks 2019-06-11 10:06:56 +02:00
Lucas Pluvinage e61263c0ac Introduce the -without-runtime option. 2019-05-06 14:35:57 +02:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01:00
Jérémie Dimino 705054b346 Delete the vmthreads library (#2289)
* Delete the deprecated vmthreads library

It was deprecated in 4.08.

* Remove the byte/native argument of init_path

It is no longer necessary.

* Error out when passing --{enable,disable}-vmthreads to ./configure

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-11 19:38:16 +01:00
Alain Frisch 7baf33d6ad
Fix PR6638: add dedicated wrning for "unused open!" (#1110) 2018-11-09 13:41:34 +01:00
Armaël Guéneau 6b16bcc4fe Add option -error-style and environment variable OCAML_ERROR_STYLE 2018-10-20 17:11:35 +02:00
Armaël Guéneau 72f472c860 Add a warning triggered on type declarations "type t = ()"
These are most likely a mistake for "type t = unit", but still valid, and lead
to quite confusing error messages afterwards because now `()` denotes two
different incompatible constructors.
2018-10-05 12:12:26 +02:00
Jérémie Dimino ee3730f9b2
Deprecate `ocamlc -vmthread` (#2038) 2018-09-13 10:42:26 +01:00
Gabriel Scherer 294934299e new -stop-after option: stop after the given compiler pass (parsing, typing) 2018-08-31 22:49:23 +02:00
Valentin Gatien-Baron 3d0299a185 Create warning 64, for uses of -unsafe with a -pp that returns a marshalled ast
Instead of the current print to stderr. This way it's treated the same
as other warnings: it has a position, colors, can be made an error,
disabled, goes in the expected formatter, is documented.
2018-07-15 15:08:38 -04:00
Valentin Gatien-Baron db86401871 missing warnings in ocamlc's man page 2018-07-15 15:01:14 -04:00
Dwight Guth 6a06a1123a add advanced option to tune performance of pattern matching compiler in case of exponential blowup 2018-06-01 23:51:56 +02:00
Perry E. Metzger 262b70d819 Document that -safe-string is the default, -unsafe-string is not
Nearly identical changes to:
   ocaml.m, ocamlc.m, ocamlopt.m, unified-options.etex

"-safe-string" has been the default since 4.06, so the assertion that
it would be the default someday, and that "-unsafe-string" is still
the default, was incorrect.
2018-06-01 14:05:08 +02:00
Gabriel Scherer 559206b4e0 ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
  a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
  and exit with a failure return value (non-0)

Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.

The following alternative behaviors were considered:

- We could print a newline after the configuration value, which
  would let users distinguish empty values from non-existing variables
  by counting the lines of output, and would also be more pleasant for
  users invoking the option from the command-line. However, the way
  bash works on Windows means that $(ocamlc -config-var foo) would keep
  a trailing \r in its output, and portable scripts would have to use
  $(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
  (This issue was pointed out by David Allsopp)

- We could print a message on the error output if the configuration
  variable does not exist. This is clearer to a human user, but it is
  annoying for scripts if they forget to silence the error output and
  get their output mixed with our error messages. The main use of this
  new feature is for scripting purposes.
2018-04-27 19:54:08 +02:00
Nicolás Ojeda Bär 6c1bec42c7 Deprecate -thread option, equivalent to -I +threads 2018-03-15 18:37:02 +01:00
Leo White 20668002bb Turn off warning 40 by default (#1333)
* Turn off warning 40 by default
2017-09-15 18:41:49 +02:00
Thomas Refis 1747a2f0eb Mention deprecated warning 25 in manual and man page
* warning 25: updated the man page

* warning 25: update the manual
2017-07-10 18:18:37 +02:00
Damien Doligez fee01100fb Some tweaks for MPR#7557 (#1213)
* fall back to __secure_getenv when secure_getenv is not available

* use secure_getenv for instrumented runtimes

* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
2017-06-28 14:08:07 +02:00
Fabrice Le Fessant 8daa184d95 New -depend option for ocamlc/ocamlopt 2017-06-01 15:56:30 +02:00
Hannes Mehnert 76bf7c568e Respect OCAML_COLOR environment variable for deciding whether to use colors
Since 4.03, OCaml supports coloring its messages to standard output and standard
error, depending on the "-color" argument ({always,never,auto}).  This commit
adds support for the environment variable "OCAML_COLOR" (which value can as well
be {always,never,auto}).

The command line argument "-color" takes precedence, "OCAML_COLOR" is only
taken into consideration if no "-color" is provided.

The motivation for this is that the user should have control over coloring
OCaml's output messages.  OCamlbuild, a widely used build tool executes OCaml
not under a tty (and OCaml does not colorize errors and warnings), which lead
various packages use `color(always)` in their `_tags` files, which breaks with
other (non-interactive) programs (i.e.  editor helpers).

Further discussion was done at https://github.com/ocaml/ocamlbuild/issues/87 and
https://github.com/ocaml/ocaml/pull/1098.
2017-03-15 08:24:13 +00:00
Gabriel Scherer 3bae6a68b4 -opaque documentation: take Mark's review comments into account 2017-02-24 21:55:14 -05:00
Gabriel Scherer 6e47bace18 differentiate the ocamlc/ocamlopt -opaque manpage 2017-02-24 21:55:13 -05:00
Konstantin Romanov 39bb4179ee Added description of -opaque to man pages. 2017-02-24 21:55:13 -05:00
Xavier Leroy 7921342073 GPR#1009: add Changes entry and update man pages 2017-01-15 20:48:39 +01:00
Damien Doligez d5a6e50ebe GPR#606: add unboxed types 2016-07-21 13:51:46 +02:00
Fabrice Le Fessant c71e4d38b2 Update the manual with the -plugin option 2016-07-19 16:54:35 +02:00
alainfrisch 32f0e2120c Detect unused module declarations. 2016-07-18 10:35:19 +02:00
whitequark be1f3cfa78 Update manpages and manual to account for changes in 221c55a4. 2016-06-14 11:36:35 -04:00
Gabriel Scherer c6fdca82b3 minor ocamlc.m fix 2016-04-18 11:25:01 -04:00
Damien Doligez df75e7e9de cut overlong lines 2016-02-25 16:51:40 +01:00
Simon Cruanes ea967c3499 add a description of the `-color` flag in the manual and manpage 2016-02-23 09:19:54 -05:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Mark Shinwell 776b489f35 add warning 59 to ocamlc.m 2016-01-14 12:06:12 +00:00
Damien Doligez 6533f3bc06 PR#5995 (cont): add a note saying that you can still pack without -for-pack but exception names will be wrong 2015-12-28 14:23:43 +01:00
alainfrisch a9854a4a3e #5995: document -for-pack as mandatory including in bytecode. This is required to get proper names for exceptions. 2015-12-11 12:58:43 +01:00
alainfrisch 79aa0b5b09 PR#5461, PR#4231: warning 31 (duplicated linking) is now a warn-error by default. 2015-12-09 18:47:47 +01:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Leo White 5c55e4cc08 Attach documentation comments to Parsetree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16189 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-28 13:11:50 +00:00
Gabriel Scherer 41e0ecf2ef PR#6642: replace $CAMLORIGIN in -ccopt with the path to cma or cmxa
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-08 11:18:29 +00:00
Gabriel Scherer 98af9c90fb Update manpage
From: Hugo Heuzard <hugo.heuzard@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15667 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:36:00 +00:00
Gabriel Scherer 44d272a34c Document -ppx option.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-04 10:39:29 +00:00
Jacques Garrigue 4365e3888e fix man pages: should be open!
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14788 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:25:57 +00:00
Jacques Garrigue ccce272966 commit o_and_opens.diff
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14787 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:17:05 +00:00
Damien Doligez f27debba97 add small precision about -warn-error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14760 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:04:47 +00:00