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-17 (14:43)
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 Archives:
Bug reports: FAQ:
Beginner's list: