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 QAA15380; Mon, 17 May 2004 16:43:07 +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 QAA15987 for ; Mon, 17 May 2004 16:43:07 +0200 (MET DST) Received: from [128.93.8.158] (macaque.inria.fr [128.93.8.158]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4HEh6EV001362 for ; Mon, 17 May 2004 16:43:06 +0200 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <20040505160230.GA26320@davidb.org> References: <20040505160230.GA26320@davidb.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <81538EBA-A810-11D8-8794-00039310CAE8@inria.fr> Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Question about warning message. Date: Mon, 17 May 2004 16:43:05 +0200 To: caml-list@inria.fr X-Mailer: Apple Mail (2.613) X-Miltered: at nez-perce with ID 40A8CF7A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 gcc:01 compiler:01 dummy:01 dummy:01 caml:01 caml:01 int:01 doligez:01 doligez:01 syntax:02 macros:03 macros:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >> my g++ compiler show me this warning: >> >> << warning: unused variable `int caml__dummy_n' >> I'd consider this a design error in g++: the variable may be unused, but its declaration is not useless because it has side effects. Instead of a warning about unused variables, it should have a warning about useless declarations. > 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. If we do that, the CAMLxparam macros can no longer be used in a context of declarations. These macros must include only definitions because of the restrictive syntax of C. I'll implement Shawn Wagner's suggestion, it is the cleanest way to deal with this problem. -- Damien ------------------- 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