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 SAA12254; Wed, 5 May 2004 18:47:18 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA11914 for ; Wed, 5 May 2004 18:47:17 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i45GlFSH013891; Wed, 5 May 2004 18:47:16 +0200 Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA11681; Wed, 5 May 2004 18:47:15 +0200 (MET DST) Date: Wed, 5 May 2004 18:47:15 +0200 From: Xavier Leroy To: Claudio Trento Cc: caml-list@inria.fr Subject: Re: [Caml-list] Question about warning message. Message-ID: <20040505184715.A10006@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from trento@di.unipi.it on Wed, May 05, 2004 at 05:16:06PM +0200 X-Miltered: at concorde with ID 40991A94.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 extern:01 camlprim:01 foo:01 camlparam:01 lacks:01 camlparam:01 gcc:01 gcc:01 damien:01 compiler:01 dummy:01 dummy:01 caml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > my g++ compiler show me this warning: > << warning: unused variable `int caml__dummy_n' >> > Here little lines of the function that generates this warning > .... > extern "C" > CAMLprim value > foo(value n) try { > CAMLparam1(n); (perhaps something lacks here?!?) > > I don't know where is the problem! Please, who can help me? There's no problem with your code, and the warning is harmless. It's just that the CAMLparam... macros used for GC root registration expand to complicated C code that happens to trigger the "unused variable" warning in gcc. David Brown suggest: > 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. Thanks for the suggestion. That might do the job. I'll let the author of these macros (Damien Doligez) respond when he's back. - Xavier Leroy ------------------- 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