Skip to content
Prev 6424 / 12125 Next

[R-pkg-devel] [Re] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

On 12/18/20 8:25 AM, Pierre Lafaye de Micheaux wrote:
Dear Pierre,


this unfortunately still does not look right. You are calling "delete[]" 
on something you have not allocated with "new". This code will not work 
(or if so, only by coincidence only sometimes, but crash other times or 
produce incorrect results) and you should be seeing a number of compiler 
warnings if not errors. "jobz" is a "char *" (unless something changed 
from you previous example), so jobz[0] is a "char", so not a pointer at all.
That would be best, but I would certainly advise against doing runtime 
tricks (such as copying the memory, etc) to silence benign compiler 
warnings. The version I was looking at seemed ok to me, and a recent 
compiler would not emit warnings - perhaps you could just upgrade your 
OS?? If you just extended the use of the FC_ macros there to make that 
work also when the hidden character arguments were not used, that would 
be good enough for now I think. For the iso_c_binding, there is an 
example in Writing R Extensions (but does not include the complex type).


Best,

Tomas