caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Roberto Bagnara <bagnara@cs.unipr.it>
To: David Brown <caml-list@davidb.org>
Cc: Claudio Trento <trento@di.unipi.it>,
	caml-list@inria.fr, ppl-devel@cs.unipr.it
Subject: Re: [Caml-list] Question about warning message.
Date: Wed, 05 May 2004 18:40:48 +0200	[thread overview]
Message-ID: <40991910.6040404@cs.unipr.it> (raw)
In-Reply-To: <20040505160230.GA26320@davidb.org>

David Brown wrote:
> On Wed, May 05, 2004 at 05:16:06PM +0200, Claudio Trento wrote:
>>my g++ compiler show me this warning:
>>  
>>    << warning: unused variable `int caml__dummy_n' >>
> 
> 
> It is part of the construct the headers use to implement the
> CAMLparam... macros.  Strictly it isn't necessary in C++, since you can
> have declarations in the middle of a block, but then there would be
> different constructs for C and C++.

That would not be a problem: most header files that must work
with both C and C++ do that.  For example, one thing that
the OCaml include files out to start and end with is

#ifdef __cplusplus
extern "C" {
#endif

...

#ifdef __cplusplus
} /* extern "C" */
#endif

Similar things based on the __cplusplus macro allows to obtain
header files that are 100% standard compliant with respect to
both C and C++.

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

This would do the trick, even though it is a bit of a hack.
What do the OCaml developers think?
Are they willing to accept patches to solve these problems?
Cheers,

     Roberto

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

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


  reply	other threads:[~2004-05-05 16:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-05 15:16 Claudio Trento
2004-05-05 16:02 ` David Brown
2004-05-05 16:40   ` Roberto Bagnara [this message]
2004-05-17 14:43   ` Damien Doligez
2004-05-17 15:31     ` Olivier Andrieu
2004-05-17 16:44     ` Roberto Bagnara
2004-05-05 16:47 ` Xavier Leroy
2004-05-05 19:22   ` Shawn Wagner
2004-05-05 20:46 ` Evan Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40991910.6040404@cs.unipr.it \
    --to=bagnara@cs.unipr.it \
    --cc=caml-list@davidb.org \
    --cc=caml-list@inria.fr \
    --cc=ppl-devel@cs.unipr.it \
    --cc=trento@di.unipi.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).