Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Question about warning message.
>> 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