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 D4CC27EEFA for ; Thu, 12 Nov 2015 10:10:49 +0100 (CET) IronPort-PHdr: 9a23:9hvZoRMrz0XiJIY4DLgl6mtUPXoX/o7sNwtQ0KIMzox0Kf37rarrMEGX3/hxlliBBdydsKIZzbKO+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStOU15z//tvx0qOQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdrce72ppIVWOg0S0vZ/or9ZLuh5dsPM59sNGTb6yP+FhFeQZXwIdLnst6cb3mR7GRAqJrjtAAyRF2iZPVkL+6xz1Qo32qm+yk+t22CCXOYe+GbU1UjSr4qMtUxjlhzsdMCYR8WfLh8g2h6Ve9kGPvRt6lqHdapuUOf42RajdcMkXXyIVUc9bTS1MBsWnZIsCFecbFeldpoj54VAJqE3tVkGXGOrzx2oQ1TfN1qog3rFkTFjL 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-io0-f170.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.223.170; 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.223.170 as permitted sender) identity=mailfrom; client-ip=209.85.223.170; 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-io0-f170.google.com) identity=helo; client-ip=209.85.223.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-io0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BsAAA/VkRWlKrfVdFeg1o0bwatFoFPhTGKIAENgWUhhW8CgS8HOBQBAQEBAQEBARABAQEBBwsLCR8wgi2CCAEBBBIRHQEIExILAQMMBgULDQICCR0CAiIBEQEFAQoSBhMIChCHdgEDEg2lEIExPjGLSIFqgnmGUgoZJwMKVoQNAQEBAQEFAQEBAQEBARYBBQ5zhVOEfoRZgxyBRAWGCwyQMYUdiAqCJJhUEiSBFx8BAYJGI4FePTSFPQEBAQ X-IPAS-Result: A0BsAAA/VkRWlKrfVdFeg1o0bwatFoFPhTGKIAENgWUhhW8CgS8HOBQBAQEBAQEBARABAQEBBwsLCR8wgi2CCAEBBBIRHQEIExILAQMMBgULDQICCR0CAiIBEQEFAQoSBhMIChCHdgEDEg2lEIExPjGLSIFqgnmGUgoZJwMKVoQNAQEBAQEFAQEBAQEBARYBBQ5zhVOEfoRZgxyBRAWGCwyQMYUdiAqCJJhUEiSBFx8BAYJGI4FePTSFPQEBAQ X-IronPort-AV: E=Sophos;i="5.20,281,1444687200"; d="scan'208";a="187166890" Received: from mail-io0-f170.google.com ([209.85.223.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 12 Nov 2015 10:10:49 +0100 Received: by iouu10 with SMTP id u10so51200433iou.0 for ; Thu, 12 Nov 2015 01:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=cUuyNN3WSbvJCBcono+uuKZ+GKeFqbWnJhu5uBIPoZ0=; b=JqzLbHWqQQcb8ana8E9SNyqtCmTCItWXMWvn/N9xUnptxz761ji0NAGW/+cgw/yRai Vs5GVXmwYCTEYyYvXmEvQoCqXDXwHgjhXNbjfmqg7hPDMeZRUsztN12Ni4YG2Cvkf6rE 88IYuzUrni3TzbH8enTV6l5GjD4xdF1yBjGiwAEZEZt9lrVaSdZfDqgoZIRDm0u7YQx7 FxRzjqDskeXcI5bJfzOZbG/n2XYMY49zuZwgT7hnZWujuskbhW4ArEOCFqaxOnk+m4Yn 0CSPQsFZSpQCH/jFe0zrFHLWYr+mmlDVNBf8YWpRmJsV4mXQusXJ1V0eQ9KsfDeWB/KX qfwg== X-Received: by 10.107.167.9 with SMTP id q9mr4849774ioe.84.1447319447801; Thu, 12 Nov 2015 01:10:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.39.200 with HTTP; Thu, 12 Nov 2015 01:10:08 -0800 (PST) In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3F4C5@IRSMSX102.ger.corp.intel.com> References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3F4C5@IRSMSX102.ger.corp.intel.com> From: Gabriel Scherer Date: Thu, 12 Nov 2015 10:10:08 +0100 Message-ID: To: "Soegtrop, Michael" Cc: caml users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Suppress warning from within Ocaml source file You can use the "warning" or "ocaml.warning" annotation: { foo with ... }[@warning "-23"] but: - it only works with OCaml 4.02.x and later - the fact that we have to use the warning number for now does not make for very readable code I would agree this warning is of debatable value: warnings should pressure us to make our code *more* robust to extension by adding new fields/variants, not *less*. On Thu, Nov 12, 2015 at 9:49 AM, Soegtrop, Michael wrote: > Dear OCaml users, > > Is there a way to suppress warnings from inside an Ocaml source file? I = know I can do this from the ocamlc command line, but I want to suppress the= warning only in specific cases and I think I should put a comment on why s= omething is suppressed. From my C background I am used to #pragma warning a= nd find it quite convenient. > > The specific warning I want to suppress is Warning 23: "all the fields ar= e explicitly listed in this record: the 'with' clause is useless". I have a= case where I might want to extend a record in the future and if I do so th= e with clause most likely would make sense, so I want to keep the with clau= se, even though it is superfluous right now. > > Best regards, > > Michael > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Christian Lamprechter > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 > > -- > 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