caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Aymeric Fromherz <aymeric.fromherz@ens.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Warning for unused variables
Date: Wed, 22 Feb 2017 20:59:28 +0100	[thread overview]
Message-ID: <58ADEDA0.8070704@ens.fr> (raw)
In-Reply-To: <CAPFanBHPX-Fw+EJ-Sh2csVFwetHnF=5KiAZnxopna1D2TBuyCA@mail.gmail.com>

Hi,

Trying with OCaml 4.04 on another machine, I have the same behaviour.
When running the ocaml interpreter with all warnings activated (-w A
option), a warning is raised in the first case, but it is a warning 27
instead of a warning 26.

What is the difference between these two warnings? Could it be that you
have all warnings activated by default?

Thanks,
Aymeric

On 22/02/2017 20:43, Gabriel Scherer wrote:
> This would be a bug, but I cannot reproduce it on my machine, where
> all OCaml versions I have (including 4.02.3) raise a warning as
> expected.
> 
> On Wed, Feb 22, 2017 at 2:21 PM, Aymeric Fromherz
> <aymeric.fromherz@ens.fr> wrote:
>> Hi,
>>
>> Using OCaml 4.02.3, I do not have a warning for unused variables when
>> only one of the variables in a pair is unused.
>> For instance, the code
>>
>> let (a,b) = (0, 42) in b;;
>>
>> raises no warning, while
>>
>> let (a,b) = (0,42) in 1;; raises the following
>>
>> Warning 26: unused variable b.
>> Warning 26: unused variable a.
>>
>> I would have expected a warning in the first case since a is unused.
>>
>> Warnings for single unused variables, such as let a = 42 in 1 are still
>> raised.
>>
>> What is the reason for this? Is this behaviour intended? How are unused
>> variables determined?
>>
>> Thanks in advance,
>> Aymeric Fromherz
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 

  reply	other threads:[~2017-02-22 19:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 17:01 [Caml-list] List of structurally typed objects Richard W.M. Jones
2017-02-22 17:09 ` Gabriel Scherer
2017-02-22 17:36   ` Richard W.M. Jones
2017-02-22 17:43     ` Nicolás Ojeda Bär
2017-02-22 17:53       ` Richard W.M. Jones
2017-02-22 17:28 ` Damien Guichard
2017-02-22 17:38   ` Richard W.M. Jones
2017-02-22 18:08     ` Ivan Gotovchits
2017-02-22 19:04       ` Mikhail Mandrykin
2017-02-22 19:21         ` [Caml-list] Warning for unused variables Aymeric Fromherz
2017-02-22 19:43           ` Gabriel Scherer
2017-02-22 19:59             ` Aymeric Fromherz [this message]
2017-02-22 20:01               ` Gabriel Scherer
2017-02-22 20:17                 ` Aymeric Fromherz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58ADEDA0.8070704@ens.fr \
    --to=aymeric.fromherz@ens.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).