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 VAA31822; Wed, 5 May 2004 21:22:52 +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 VAA31264 for ; Wed, 5 May 2004 21:22:51 +0200 (MET DST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i45JMmSH032387 for ; Wed, 5 May 2004 21:22:49 +0200 Received: (qmail 28529 invoked by uid 64014); 5 May 2004 19:22:47 -0000 Received: from shawnw@speakeasy.org by mail1.speakeasy.net with AmikaGuardian-Server-2.1.2; 05 May 2004 19:22:47 -0000 X-AmikaGuardian-Id: mail1.speakeasy.net108378496726128514 X-AmikaGuardian-Category: AN:Override Structure : 2.85 X-AmikaGuardian-Category: AN:Vectored : 2.85 X-AmikaGuardian-Category: AN:Forwarded Mail : 2.85 X-AmikaGuardian-Category: AN:Override : 2.85 X-AmikaGuardian-Category: AN:Exception : 2.85 X-AmikaGuardian-Action: Do Nothing() Received: from dialup-4.242.102.232.dial1.seattle1.level3.net (HELO sherlock.localdomain) (shawnw@[4.242.102.232]) (envelope-sender ) by mail1.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 5 May 2004 19:22:47 -0000 Received: by sherlock.localdomain (Postfix, from userid 502) id 490EFFD15; Wed, 5 May 2004 12:22:03 -0700 (PDT) Date: Wed, 5 May 2004 12:22:03 -0700 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] Question about warning message. Message-ID: <20040505192203.GE524@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <20040505184715.A10006@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040505184715.A10006@pauillac.inria.fr> User-Agent: Mutt/1.4.2i X-Miltered: at concorde with ID 40993F08.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shawnw:01 caml-list:01 2004:99 extern:01 camlprim:01 foo:01 camlparam:01 lacks:01 camlparam:01 gcc:01 gcc:01 damien:01 shawnw:01 compiler:01 dummy:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, May 05, 2004 at 06:47:15PM +0200, Xavier Leroy wrote: > > 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. > A better solution for gcc (And, I think, icc) is to use the unused attribute when the variable's declared. Something like blah caml__dummy_##x __attribute__((__unused__)); -- Shawn Wagner shawnw@speakeasy.org ------------------- 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