From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 977747F616 for ; Wed, 22 Feb 2017 21:02:01 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-qt0-f171.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.216.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.216.171 as permitted sender) identity=mailfrom; client-ip=209.85.216.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qt0-f171.google.com) identity=helo; client-ip=209.85.216.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-qt0-f171.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AZmJ1xhfR24GwqpalyVeTWWrslGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc6+Yh7h7PlgxGXEQZ/co6odzbGH7ua5BydZus3J8ChbNscTB1ld0Y?= =?us-ascii?q?RetjdjKfDGIHWzFOTtYS0+EZYKf35e1Fb/D3JoHt3jbUbZuHy44G1aMBz+MQ1o?= =?us-ascii?q?Ora9QdaK3Iyfntq/8JzLYghOmCH1IfYrdE33/jPqq9IOjIB+BqE0wxrP6jsUKq?= =?us-ascii?q?UFjV9vcHuCmhvm58z40oRk9iRdoeBpo8dRVKjgfq9+Q6ZfCTQrKXId6cvw8xfZ?= =?us-ascii?q?G1ih/HwZB0ofmABJDgyN1xr6U438qGOuueN3wiiXOYvtRrA5Qzm4x6huQR7szi?= =?us-ascii?q?wAMmhqoynslsVsgfcD81qarBtlztuRPdiY?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B7AgDh7a1YhqvYVdFeGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBg0g/gQkHg1SbYoI6hkCORyqFeAKDAAdDFAE?= =?us-ascii?q?BAQEBAQEBAQEBEgEBAQgLCwodL4IzBAEdBYIXAQUjHQEbEgsBAwwGBQsNAgIJH?= =?us-ascii?q?QICIgERAQUBChIGExKJSgEDFQ6icT+MA4IEBQEcgwkFg2YKGScDClWDFQEBAQE?= =?us-ascii?q?BAQEDAQEBAQEBARkCBhJ5hUGEb4RCgxiCXwWHOAyJB4tFggKEcosvgk6OQpFeF?= =?us-ascii?q?B6BFTaBISEUH1MXhCUgggsiNYhFgU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0B7AgDh7a1YhqvYVdFeGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBg0g/gQkHg1SbYoI6hkCORyqFeAKDAAdDFAEBAQEBAQEBAQEBE?= =?us-ascii?q?gEBAQgLCwodL4IzBAEdBYIXAQUjHQEbEgsBAwwGBQsNAgIJHQICIgERAQUBChI?= =?us-ascii?q?GExKJSgEDFQ6icT+MA4IEBQEcgwkFg2YKGScDClWDFQEBAQEBAQEDAQEBAQEBA?= =?us-ascii?q?RkCBhJ5hUGEb4RCgxiCXwWHOAyJB4tFggKEcosvgk6OQpFeFB6BFTaBISEUH1M?= =?us-ascii?q?XhCUgggsiNYhFgU8BAQE?= X-IronPort-AV: E=Sophos;i="5.35,196,1484002800"; d="scan'208";a="261700139" Received: from mail-qt0-f171.google.com ([209.85.216.171]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 22 Feb 2017 21:01:48 +0100 Received: by mail-qt0-f171.google.com with SMTP id b16so12254491qte.0 for ; Wed, 22 Feb 2017 12:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iYHeaR6gVAFpXs6FstVu5H76vkTZLPFfXLeDZ0WEMf8=; b=CxEDgy58lgd/AOQioL8aF5WZHHrY/FcopkIySyrSn66xR/nM08sCZpk05Or0yp4dUr gO3IyRmxu1mLQdBNd6+1U6qC4KgM8eNJ++qB/QmZvp5YnnOgTo3aNPMiWiTdHePqHgUh sl7rYeKVKvGYrtsL9Wv1jaHoTmBKwRWFPeaGGkm7jvL7UGqmYq9EFxH7NzVLMGv0n+wG gAbbS4iuWk8M4rKyXPXOEyk1P7y4LKeheuhYO3kQEOyCmJaiAcOjbF0cXwJfODV441uq V+bN2Wgka0tRnyTYtDrPiiaZuQhqcTu/Rsqnca+coWHTBlyrkDjHa4wYzXwRg6DAyP55 Re2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iYHeaR6gVAFpXs6FstVu5H76vkTZLPFfXLeDZ0WEMf8=; b=pYfnEqsPdlebxPNP+x8/E9EdmJ7Z6j2JfY2RlyUcMNOo2r8MxN9vfvZySWgWvAHkbr HbhOMwd3IehTndyzINXt+aEPoNDoPJSomEvSpuUkc9Tl+8EDLvMmeVnQVTdVfG03AIT2 2XbaZ6bNsy8JZ6F6YLiRPAyuB4eMW4t17l598U0vgIsVEk9w0CpkeXS7ggdp5RvnVFUZ /TeM4qolw/COWYwERTEIxkDYQHy5NPLIKaimnyHNQWd2KGrkEpP5Lqz1Y8EFwASviO3e 191qGmAQ2KHnOjczSaJlkA9Ld8rUqJn0ZUX55Oziuen7OME/9VaztXz20BK/dX3DnnyJ 67hQ== X-Gm-Message-State: AMke39kKQ9GuYKfJ3c/PZhaFiSa/nsiKo1jMD+QKHR+kTeABJ6PmHjJuvTN0WgDLiBWX3YbW/4Lme5XH7cG/cA== X-Received: by 10.237.55.169 with SMTP id j38mr30311169qtb.286.1487793707572; Wed, 22 Feb 2017 12:01:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.177.154 with HTTP; Wed, 22 Feb 2017 12:01:07 -0800 (PST) In-Reply-To: <58ADEDA0.8070704@ens.fr> References: <20170222170101.GE28111@annexia.org> <20170222173814.GG28111@annexia.org> <2432820.aHjfWRbG44@molnar> <58ADE4A2.9060105@ens.fr> <58ADEDA0.8070704@ens.fr> From: Gabriel Scherer Date: Wed, 22 Feb 2017 15:01:07 -0500 Message-ID: To: Aymeric Fromherz Cc: caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Warning for unused variables Good point, I had not noticed the different in warning number. `ocamlc -warn-help` says: 26 Suspicious unused variable: unused variable that is bound with "let" or "as", and doesn't start with an underscore ("_") character. 27 Innocuous unused variable: unused variable that is not bound with "let" nor "as", and doesn't start with an underscore ("_") character. I agree that the distinction is somewhat arbitrary here: arguably variables bound in a pattern by a *let* (instead of a pattern-matching) could be considered "suspicous" as well. But we don't want to change the semantics of an existing pattern too much, as it tends to annoy people, so maybe it's best left as it is. On Wed, Feb 22, 2017 at 2:59 PM, Aymeric Fromherz wrote: > 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 >> 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 >> > > -- > 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