From anders at embl.de  Wed Jan  6 16:26:26 2010
From: anders at embl.de (Simon Anders)
Date: Wed, 06 Jan 2010 16:26:26 +0100
Subject: [Rd] =?utf-8?q?R=5Fext_manual=3A_type_cast_in_C_function_registra?=
 =?utf-8?q?tion?=
Message-ID: <e726d60b426e79591232c6b10dee09bf@imap.embl.de>

Hi,

the "Writing R extensions" manual currently advises to register a .Call
function as follows:

   R_CallMethodDef callMethods[]  = {
       {"myCall", &myCall, 3},
       {NULL, NULL, 0}
   };

This produces a compiler warning, at least on my GCC, because the second
slot in the R_CallMethodDef is declared as DL_FUNC (which is declared as
'typedef void * (*DL_FUNC)();').

I'd suggest to change the example code in the manual to include an
explicit cast, i.e., 


   R_CallMethodDef callMethods[]  = {
       {"myCall", (DL_FUNC) &myCall, 3},
       {NULL, NULL, 0}
   };

in order to get rid of an unnecessary compiler warning.

Cheers
  Simon


+---
| Dr. Simon Anders, Dipl.-Phys.
| European Molecular Biology Laboratory (EMBL), Heidelberg
| office phone +49-6221-387-8632
| preferred (permanent) e-mail: sanders at fs.tum.de



[Rd] =?utf-8?q?R=5Fext_manual=3A_type_cast_in_C_function_registra?= =?utf-8?q?tion?=
Simon Anders