On 2020-01-29 13:29, Charles Mills wrote:
If you're not a C++ person you may hit Delete at any time ...
I want to load a module that is a non-executable table (and non-reentrant)
and then modify it.
I have the entry point declared as
extern "OS" typedef int compiler_t(void *parm1);
compiler_t *opts;
(compiler_t is what is expected by several methods unrelated to this exact
question, and this all works, so I would like to leave that alone.)
When I want to modify it I want to treat it as a struct. So I say
myStruct *opts_char = reinterpret_cast<myStruct *>(opts);
That generates the following warning in XLC:
CCN5216 (W) An expression of type "extern "OS" int (*)(void *)" cannot be
converted to type "myStruct *".
The code all works perfectly. I'd just like to get rid of the warning.
Anyone know what to do?
Charles
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
I'm not in a position to test this right now, but does this work:
myStruct *opts_char = reinterpret_cast<myStruct *>((void *) opts);
--
Regards, Gord Tomlin
Action Software International
(a division of Mazda Computer Corporation)
Tel: (905) 470-7113, Fax: (905) 470-6507
Support: https://actionsoftware.com/support/
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN