[PPL-devel] [Fwd: Re: [Caml-list] Question about warning message.]

Roberto Bagnara bagnara at cs.unipr.it
Wed May 5 18:58:03 CEST 2004



-------- Original Message --------
Subject: Re: [Caml-list] Question about warning message.
Date: Wed, 5 May 2004 18:47:15 +0200
From: Xavier Leroy <xavier.leroy at inria.fr>
To: Claudio Trento <trento at di.unipi.it>
CC: caml-list at inria.fr
References: <Pine.LNX.4.44.0405051658360.1700-100000 at nutella.di.unipi.it>

> 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 at 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


-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list