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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1C2E17F108 for ; Tue, 24 Nov 2015 19:53:20 +0100 (CET) IronPort-PHdr: 9a23:ki2fyRZ2tHnbprberdRxdkr/LSx+4OfEezUN459isYplN5qZpcu+bnLW6fgltlLVR4KTs6sC0LqL9f++EjBYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh730pMOYP10ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIZoGJ/3dKUgTLFeEC9ucyVsvJWq5lH/Sl6k734YGkEXiQYAVwPM6RW/WpbqrgP7sPB80W+UJ5ulY6ozXGGL9KdqUx+goSgOLSEw9CmDg8N5lr1SpEvw+EFXzIvdYYXTP/17KPCONegGTHZMC54CHxdKBZmxOs5WV7IM Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=agarwal1975@gmail.com; spf=Pass smtp.mailfrom=agarwal1975@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f41.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of agarwal1975@gmail.com designates 74.125.82.41 as permitted sender) identity=mailfrom; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f41.google.com) identity=helo; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-wm0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BQAgCmsVRWlClSfUpeg1o0bwatCIcHiXyCHhcBCYcsBzsRAQEBAQEBAQEQAQEBAQcLCwkfMEEOAYFdgiARHQEbHgMSEDcCJAERAQUBFgwuB4d2AQMSDZ4ZggiBMT4xi0iBaoJ5hgYKGScNVoQ7AQUOkn8MLhOBMQWOFIg1B4UkiA2CJJhaEiSBFxEmglOBeyA0AYFKg2ABAQE X-IPAS-Result: A0BQAgCmsVRWlClSfUpeg1o0bwatCIcHiXyCHhcBCYcsBzsRAQEBAQEBAQEQAQEBAQcLCwkfMEEOAYFdgiARHQEbHgMSEDcCJAERAQUBFgwuB4d2AQMSDZ4ZggiBMT4xi0iBaoJ5hgYKGScNVoQ7AQUOkn8MLhOBMQWOFIg1B4UkiA2CJJhaEiSBFxEmglOBeyA0AYFKg2ABAQE X-IronPort-AV: E=Sophos;i="5.20,339,1444687200"; d="scan'208";a="154995918" Received: from mail-wm0-f41.google.com ([74.125.82.41]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 24 Nov 2015 19:53:19 +0100 Received: by wmvv187 with SMTP id v187so224059830wmv.1 for ; Tue, 24 Nov 2015 10:53:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=vCO7Gah7MQxHV83669LaWl6YO942Rd3jhdoplqptePU=; b=I91eWUb1nSc5BSXW4xI5vw2Cl7ZrhzNOq4GSAaZAs+RXA2T599ive54ydJbP77LMr5 ommHO+wwAvKWpA3d5MV+YQ8Q8XGAY4f9dXnoQLRK91X/6LuqxRzmeQVZI4aNIK3db85G /ipf0xpUb103RxB5ivcLz0UXwFc3USDl5X1rwfph20ColIVj2ZeZ+mXTHhjxIwU1LhsY 75dBO8jJnjYLXc0xJARKmaC0RsBYAKmw5+bzHojnkM3g59hfKLlLBpNHWMO9/sVLN7Eu fWG5vbR9BMNO8KISTB27FZwbFp2efMBe1YxK84UnT6JWFRkOQjKPxSJ13kWgJifioiEV +2BQ== X-Received: by 10.194.82.229 with SMTP id l5mr43564026wjy.140.1448391198893; Tue, 24 Nov 2015 10:53:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.27.82.65 with HTTP; Tue, 24 Nov 2015 10:52:59 -0800 (PST) From: Ashish Agarwal Date: Tue, 24 Nov 2015 13:52:59 -0500 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=047d7bb03f40e7ecfa05254dda8e Subject: [Caml-list] how to apply an attribute on ppx output --047d7bb03f40e7ecfa05254dda8e Content-Type: text/plain; charset=UTF-8 $ cat foo.mli type t $ cat foo.ml type t = {a:int} [@@deriving fields] $ ocamlfind ocamlc -package ppx_fields_conv,fieldslib -w A -c foo.mli $ ocamlfind ocamlc -package ppx_fields_conv,fieldslib -w A -c foo.ml File "foo.ml", line 1, characters 5-6: Warning 32: unused value names. File "foo.ml", line 1, characters 5-6: Warning 32: unused value make_creator. File "foo.ml", line 1, characters 5-6: Warning 32: unused value create. File "foo.ml", line 1, characters 5-6: Warning 32: unused value map. File "foo.ml", line 1, characters 5-6: Warning 32: unused value iter. File "foo.ml", line 1, characters 5-6: Warning 32: unused value fold. File "foo.ml", line 1, characters 5-6: Warning 32: unused value map_poly. File "foo.ml", line 1, characters 5-6: Warning 32: unused value for_all. File "foo.ml", line 1, characters 5-6: Warning 32: unused value exists. File "foo.ml", line 1, characters 5-6: Warning 32: unused value to_list. File "foo.ml", line 1, characters 5-6: Warning 32: unused value iter. File "foo.ml", line 1, characters 5-6: Warning 32: unused value fold. File "foo.ml", line 1, characters 5-6: Warning 32: unused value set_all_mutable_fields. Thus, I'd like to disable warning 32, but only for the items generated by the ppx extension. I've tried adding [@@warning "-32"] in various places but it understandably doesn't work. So then I tried defining an internal module and disabling in the entire module like this: $ cat foo.ml module T = struct [@@warning "-32"] type t = {a:int} [@@deriving fields] end include T However I get a syntax error, even though this follows the example of the manual in section 7.221 . Is this a bug in the manual? According to the grammar it seems the attribute should be added after the module expression: $ cat foo.ml module T = struct type t = {a:int} [@@deriving fields] end [@@warning "-32"] include T This compiles, but the warnings don't go away. Is there a solution? --047d7bb03f40e7ecfa05254dda8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
$ cat foo.mli
type t

$ cat foo.ml
type t =3D {a:int} [@@deriving= fields]

$ ocamlfind ocamlc -package ppx_field= s_conv,fieldslib -w A -c foo.mli

$ ocamlfind = ocamlc -package ppx_fields_conv,fieldslib -w A -c foo.ml
File "foo.ml"= , line 1, characters 5-6:
Warning 32: unused value names.
File "foo.ml", line 1, character= s 5-6:
Warning 32: unused value make_creator.
File &quo= t;foo.ml", line 1, characters 5-6:
=
Warning 32: unused value create.
File "foo.ml", line 1, characters 5-6:
Warning 32: u= nused value map.
File "foo.ml&= quot;, line 1, characters 5-6:
Warning 32: unused value iter.
File "foo.ml", line 1, chara= cters 5-6:
Warning 32: unused value fold.
File "foo.ml", line 1, characters 5-6:
Warning 32: unused value map_poly.
File "foo.ml", line 1, characters 5-6:
Warning 32: unu= sed value for_all.
File "foo.ml", line 1, c= haracters 5-6:
Warning 32: unused value to_list.
File &= quot;foo.ml", line 1, characters 5-6:
Warning 32: unused value iter.
File "foo.ml", line 1, characters 5-6:
Warning 32: = unused value fold.


module T =3D struct
=C2=A0 [@@warning "-32"]
=C2=A0 type t =3D {a:int= } [@@deriving fields]
end
include T
However I get a syntax error, even though this follows the exam= ple of the manual in section 7.221. Is this a bug in the manual? According= to the grammar it seems the attribute should be added after the module exp= ression:

$ cat foo.ml
--047d7bb03f40e7ecfa05254dda8e--