Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Question about warning message.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-05 (16:47)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Question about warning message.
> 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 Archives:
Bug reports: FAQ:
Beginner's list: