From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA10584; Wed, 5 May 2004 18:41:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA11099 for ; Wed, 5 May 2004 18:41:36 +0200 (MET DST) Received: from spartacus.cs.unipr.it ([160.78.167.140]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i45GfZEV030839 for ; Wed, 5 May 2004 18:41:35 +0200 Received: from cs.unipr.it (localhost [127.0.0.1]) by spartacus.cs.unipr.it (8.12.8/8.12.8) with ESMTP id i45GemHm029327; Wed, 5 May 2004 18:40:48 +0200 Message-ID: <40991910.6040404@cs.unipr.it> Date: Wed, 05 May 2004 18:40:48 +0200 From: Roberto Bagnara Organization: Department of Mathematics, University of Parma, Italy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: David Brown CC: Claudio Trento , caml-list@inria.fr, ppl-devel@cs.unipr.it Subject: Re: [Caml-list] Question about warning message. References: <20040505160230.GA26320@davidb.org> In-Reply-To: <20040505160230.GA26320@davidb.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4099193F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 trento:99 camlparam:01 cplusplus:01 extern:01 cplusplus:01 extern:01 gcc:01 compiler:01 ifdef:01 ifdef:01 dummy:01 dummy:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk David Brown wrote: > On Wed, May 05, 2004 at 05:16:06PM +0200, Claudio Trento wrote: >>my g++ compiler show me this warning: >> >> << warning: unused variable `int caml__dummy_n' >> > > > It is part of the construct the headers use to implement the > CAMLparam... macros. Strictly it isn't necessary in C++, since you can > have declarations in the middle of a block, but then there would be > different constructs for C and C++. That would not be a problem: most header files that must work with both C and C++ do that. For example, one thing that the OCaml include files out to start and end with is #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } /* extern "C" */ #endif Similar things based on the __cplusplus macro allows to obtain header files that are 100% standard compliant with respect to both C and C++. > BTW, what about having a > (void) caml__dummy_##x; > > at the end of the CAMLxparam... macros? This does shut up the warning, > at least on gcc. This would do the trick, even though it is a bit of a hack. What do the OCaml developers think? Are they willing to accept patches to solve these problems? Cheers, Roberto -- Prof. Roberto Bagnara Computer Science Group Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~bagnara/ mailto:bagnara@cs.unipr.it ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners